Consulting

Results 1 to 3 of 3

Thread: Solved: Tweeking formula

  1. #1
    VBAX Mentor
    Joined
    Aug 2011
    Posts
    353
    Location

    Solved: Tweeking formula

    [VBA]Sub Maturity()
    '
    ' Lookup Maturity

    Windows("sunrise.csv").Activate
    Application.Run "BLPLinkReset"

    Range("AB7").Resize(Range("A2").End(xlDown).Row - 1).FormulaR1C1 = _
    "=VLOOKUP(RC[-27],'[Sunrise Perform Input 8.31.2011.xls]Sheet1'!R1:R65536,10,FALSE)"


    End Sub[/VBA]

    how do i get this formula to fill down all AB cells that are present? Could be AB2 to AB20, could be AB2 to AB100. etc..
    Last edited by Bob Phillips; 09-13-2011 at 01:57 AM.

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    hi.
    try...


    [VBA]
    Dim LastRow As Long

    'row num of last cell with data, column A:
    LastRow = Cells(Rows.Count, "A").End(xlUp).Row

    Range("AB2:AB" & LastRow).FormulaR1C1 = _
    "=VLOOKUP(RC[-27],'[Sunrise Perform Input 8.31.2011.xls]Sheet1'!R1:R65536,10,FALSE)"

    [/VBA]
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    ps: not sure if this part is true: Sheet1!R1:R65536
    maybe Sheet1!C1:C256 or Sheet1'!R1C1:R65536C256
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

Posting Permissions

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