+ Reply to Thread
Results 1 to 5 of 5

Change to variable name

  1. #1
    Registered User
    Join Date
    11-22-2006
    Posts
    19

    Change to variable name

    Hi there

    Need your help please on my recorded macro;

    ActiveCell.FormulaR1C1 = "GADNN01",

    The "GADNN01" is different from every data, so how can i change to variable so as when i open this macro, the macro will detect whatever name as that line?

    appreciate for your help

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Moshin,

    Add a variable above the active cell assigment line...

    varData = "My data"
    ActiveCell.FormulaR1C1 = varData

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    11-22-2006
    Posts
    19
    Hi Leith Ross

    Thank you for your responces,
    I just try your's suggestion, but the macro put the "my data" to replace the "GADNN01". What i need is to replace whatever "name" as in that line. The macro like this;
    Please Login or Register  to view this content.
    the macro will copy a data from range C7 (can be any name) and put in A2, so the "GADNN01" is changing from every data, as in C7

    Appreciate for your help, thank you

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try
    Please Login or Register  to view this content.
    if you don't need the message then

    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 02-11-2007 at 06:31 AM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Registered User
    Join Date
    11-22-2006
    Posts
    19
    Hi

    It's works, thanks VBA Noob and leith ross, for your help.

    How can i use the function, = left("Mydata",length) as vba code?

    thank you
    Last edited by VBA Noob; 02-11-2007 at 08:13 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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