Link to home
Create AccountLog in
Avatar of BBRRGG
BBRRGG

asked on

Adding straight text into specific cells in VBA

Need to insert text into specific cells.  To insert into K5 and L5, I understand this code to be:
    Range("K5").Select
    ActiveCell.FormulaR1C1 = "Text1"
    Range("L5").Select
    ActiveCell.FormulaR1C1 = "Text2"

In my program, I need to specify the wkst, so I'm using:
    xl.Worksheets("Sheet3").Range("K5").Select
    ActiveCell.FormulaR1C1 = "Text1"
    xl.Worksheets("Sheet3").Range("L5").Select
    ActiveCell.FormulaR1C1 = "Text2"

However, when it runs, it just shows up with these cells selected but with no text in the cells.  Suggestions?
ASKER CERTIFIED SOLUTION
Avatar of Rory Archibald
Rory Archibald
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of BBRRGG
BBRRGG

ASKER

Thanks!