Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Cleaning up the syntax
Hi,
I have 2 lines of code Which works perfectly fine Cells(1, 1) = "=VLookup(" & """" & sheeetname & """" & " , m7:n" & opi & ", 2, False)" Worksheets("" & Cells(1, 1) & "").Select Can I somehow reduce them to one line of code by not using cells(1,1) as an intermediary. I tried the following variations a) Worksheets("" & Application.VLookup("""" & sheeetname & """", "m7:n" & opi, 2, False) & "").Select b) Worksheets(Application.VLookup("""" & sheeetname & """", "m7:n" & opi, 2, False)).Select c) Worksheets(Application.VLookup(""" & sheeetname & """, "m7:n" & opi, 2, False)).Select But getting Run-time error 13, type mismatch. Please guide me. Thanks a lot, Hari India |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Cleaning | Excel Discussion (Misc queries) | |||
Help with cleaning up a workbook. | Excel Discussion (Misc queries) | |||
Cleaning up some VB | Excel Programming | |||
Help cleaning up some Strings | Excel Programming | |||
cleaning up a field | Excel Programming |