+ Reply to Thread
Results 1 to 6 of 6

Reference Worksheet CodeName in VBA

  1. #1
    Forum Contributor amyxkatexx's Avatar
    Join Date
    11-23-2009
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    128

    Reference Worksheet CodeName in VBA

    Attached is a test file I am working on. What I am trying to accomplish is the ability to pull a value from the same cell in different sheets and list them on the first sheet. The issue I seem to be having is that I have no idea how to tell it to copy cell D2 from Sheet2, then paste it in D2 in Sheet1 and then move to Sheet3 and paste that value on Sheet1 and so on...

    Can anyone guess what is wrong with it?

    Here is the code if you don't wanna download the file:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by amyxkatexx; 09-16-2010 at 11:34 AM. Reason: I accidentally used D4 in test.xls, when I meant D2. This has been corrected now.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Reference Worksheet CodeName in VBA

    Why are you trying to use the code name for this? Why not just copy?
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor amyxkatexx's Avatar
    Join Date
    11-23-2009
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    128

    Re: Reference Worksheet CodeName in VBA

    I am not sure what you mean. This will eventually be applied to a workbook with 100+ worksheets (all with random names) and I simply want to insert a worksheet in the front and then run this macro so that it will copy each item number from D2 in each sheet and then paste that item number in the next cell in Sheet1.

    How else are you suggesting I accomplish this?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Reference Worksheet CodeName in VBA

    A simple loop:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor amyxkatexx's Avatar
    Join Date
    11-23-2009
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2004 for Mac
    Posts
    128

    Re: Reference Worksheet CodeName in VBA

    I hate you, that is so simple!

    Why do I always try to over-complicate things!

    That is perfect, thanks so much!

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Reference Worksheet CodeName in VBA

    I'm a simple guy, so I try to stick with things I understand!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1