+ Reply to Thread
Results 1 to 3 of 3

Do Loop with variable output

  1. #1
    Registered User
    Join Date
    06-29-2005
    Posts
    12

    Do Loop with variable output

    Hi,

    I have written the code below to basically populate column C within a sheet called Source. It takes the contents of the column BH in the same sheet and appends a hypen and a number corresponding to the row.
    For example: AO145-090909-1 where AO145-090909 is the contents of C, the - is appended and 1 is the row that it is present within.

    The problem that I am having is around:

    ActiveCell.FormulaR1C1 = "=(RC[-42]&""-""&RowCount)"

    By adding the variable RowCount into this part of the code it fails. But I need to add the row count into the cell.

    Please Login or Register  to view this content.
    Thanks for any help, its greatly receieved.

    tubbsy

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This will be a lot faster

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-29-2005
    Posts
    12

    Smile

    Thats great. Thanks royUK.

    Is it possible to adapt this code to reference mulitiple sheets?

    For instance, if I wanted to populate the cell A1 with concataneted data from two separate cells in two separate sheets. I had written the following code to do this:

    Please Login or Register  to view this content.
    Thanks again

+ 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