+ Reply to Thread
Results 1 to 2 of 2

VBA ActiveCell.Formula issue

Hybrid View

Bedlam VBA ActiveCell.Formula issue 11-07-2011, 10:44 AM
Domski Re: VBA ActiveCell.Formula... 11-07-2011, 10:51 AM
  1. #1
    Registered User
    Join Date
    11-02-2011
    Location
    South Carolina, USA
    MS-Off Ver
    Excel 2007
    Posts
    24

    VBA ActiveCell.Formula issue

    hello happy monday to every one lol... I'm needing a bit of help when it comes to pasting this formula in cell B2 down. Just for simplicity for now NumRows = 100 but i cannot get this formula to work in my worksheet. It needs to change from A2 to A3 etc but I am not too great on using FormulaR1C1. If anyone could give me help it would be fantastic. Thanks everyone!

        Cells(1, 2) = "Deleted Account Names"
        For Row = 1 To NumRows
        Cells(Row + 1, 2).Select
        ActiveCell.Formula = "=IF(LEFT(A2,4)='RSOF',VLOOKUP(A7,'Summary Total'!A12:B131,2,FALSE),VLOOKUP(A2,Composites!$A$12:$B$132,2,FALSE))"
        Columns.AutoFit
        Next Row

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: VBA ActiveCell.Formula issue

    Try:

    Cells(1, 2) = "Deleted Account Names"
    Cells(2, 2).Resize(NumRows, 1).Formula = "=IF(LEFT(A2,4)=""RSOF"",VLOOKUP(A7,'Summary Total'!A12:B131,2,FALSE),VLOOKUP(A2,Composites!$A$12:$B$132,2,FALSE))"
    Columns.AutoFit

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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