I'm trying to automate some excel procedures using vba. Currently I'm having difficulties when I need to insert a formula into a cell that takes values such as the row and the sheet name in a file, and passes then into the formula.
SheetName is entered in a form.
MyRow = Selection.Row
Formula1 = "=LOOKUP($A MyRow,'Locationoffile\[Filename]SheetName'!R8C1:R33C1,'Locationoffile\[Filename]SheetName'!R8C5:R33C5)"
Any help, hints etc., would be brilliant.
Thanks
SheetName is entered in a form.
MyRow = Selection.Row
Formula1 = "=LOOKUP($A MyRow,'Locationoffile\[Filename]SheetName'!R8C1:R33C1,'Locationoffile\[Filename]SheetName'!R8C5:R33C5)"
Any help, hints etc., would be brilliant.
Thanks