Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Vlookup in VBA

I'm trying without success to place the following formula into cell C1 via
VBA code, the formula works fine within the spreadsheet:

=VLOOKUP(LEFT(A1,3),myfile.xls!Database,2,FALSE)&" "&A1&" W/E:
"&TEXT(B1,"dd-mmm-yyy")

So far i've got this part to work but the A1 and B1 elements just don't want
to know!

Range("C1").Formula = "=VLOOKUP(LEFT(A1,3),"myfile!Database,2,FALSE) "

Any help will be most welcome. Rob


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Vlookup in VBA

Hi Rob,

Maybe a typo?
--

Kind Regards,

Niek Otten

Microsoft MVP - Excel
Leave out the quote before myfile

"Rob" wrote in message
...
I'm trying without success to place the following formula into cell C1 via
VBA code, the formula works fine within the spreadsheet:

=VLOOKUP(LEFT(A1,3),myfile.xls!Database,2,FALSE)&" "&A1&" W/E:
"&TEXT(B1,"dd-mmm-yyy")

So far i've got this part to work but the A1 and B1 elements just don't

want
to know!

Range("C1").Formula = "=VLOOKUP(LEFT(A1,3),"myfile!Database,2,FALSE) "

Any help will be most welcome. Rob




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Vlookup in VBA

Rob,

Is this what you want

Range("C1").Formula =
"=VLOOKUP(LEFT(A1,3),myfile.xls!Database,2,FALSE)& A1&"" W/E: ""&Text(B1,
""dd-mmm-yyy"")"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
I'm trying without success to place the following formula into cell C1 via
VBA code, the formula works fine within the spreadsheet:

=VLOOKUP(LEFT(A1,3),myfile.xls!Database,2,FALSE)&" "&A1&" W/E:
"&TEXT(B1,"dd-mmm-yyy")

So far i've got this part to work but the A1 and B1 elements just don't

want
to know!

Range("C1").Formula = "=VLOOKUP(LEFT(A1,3),"myfile!Database,2,FALSE) "

Any help will be most welcome. Rob




  #4   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 234
Default Vlookup in VBA

Bob,
Thanks once again, it was the double quotes"".

Regards, Rob
"Bob Phillips" wrote in message
...
Rob,

Is this what you want

Range("C1").Formula =
"=VLOOKUP(LEFT(A1,3),myfile.xls!Database,2,FALSE)& A1&"" W/E: ""&Text(B1,
""dd-mmm-yyy"")"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
I'm trying without success to place the following formula into cell C1

via
VBA code, the formula works fine within the spreadsheet:

=VLOOKUP(LEFT(A1,3),myfile.xls!Database,2,FALSE)&" "&A1&" W/E:
"&TEXT(B1,"dd-mmm-yyy")

So far i've got this part to work but the A1 and B1 elements just don't

want
to know!

Range("C1").Formula = "=VLOOKUP(LEFT(A1,3),"myfile!Database,2,FALSE) "

Any help will be most welcome. Rob






Reply
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
If (Vlookup 0) working, but what if Vlookup cell does not exist Steve Excel Worksheet Functions 18 November 18th 09 07:33 PM
VLookUp - Does the VLookUp return the exact information? Cpviv Excel Worksheet Functions 2 October 28th 08 09:57 AM
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


All times are GMT +1. The time now is 12:30 PM.

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"