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?
Visual Basic ClassicMicrosoft Excel

Avatar of undefined
Last Comment
BBRRGG

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rory Archibald

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
BBRRGG

ASKER
Thanks!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy