LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Cleaning RMT Excel Discussion (Misc queries) 4 November 6th 07 07:34 PM
Help with cleaning up a workbook. Dolphy Excel Discussion (Misc queries) 1 July 25th 07 07:32 AM
Cleaning up some VB Ton Taetsch Excel Programming 1 November 16th 04 12:53 AM
Help cleaning up some Strings 43N79W Excel Programming 6 September 4th 04 01:04 PM
cleaning up a field Alex Zaft Excel Programming 2 January 7th 04 05:55 PM


All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"