Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Vaiable in range().formula

Hi

This is probably quite trivial, but how do I do somthing like this:

ActiveSheet.Range("A1").Formula "=VLOOKUP(" & strLookValue(intLookNum) &
",Setup!A1:A15,2,FALSE)"

I am trying to add a variable from an array to the VLOOKUP formula.

/Sune
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Vaiable in range().formula

Maybe you need

ActiveSheet.Range("A1").Formula = "=VLOOKUP(""" & _
strLookValue(intLookNum) & """,Setup!A1:A15,2,FALSE)"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Sune Fibaek" wrote in message
...
Hi

This is probably quite trivial, but how do I do somthing like this:

ActiveSheet.Range("A1").Formula "=VLOOKUP(" & strLookValue(intLookNum) &
",Setup!A1:A15,2,FALSE)"

I am trying to add a variable from an array to the VLOOKUP formula.

/Sune



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Vaiable in range().formula


Maybe you need


That just may be!

ActiveSheet.Range("A1").Formula = "=VLOOKUP(""" & _
strLookValue(intLookNum) & """,Setup!A1:A15,2,FALSE)"


The third quote did the trick. I'd tried two, but not three.

Thank you very much!

/Sune
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Vaiable in range().formula

I bet you have to increase the number of columns in your lookup range, too.

A1:B15????

Sune Fibaek wrote:

Hi

This is probably quite trivial, but how do I do somthing like this:

ActiveSheet.Range("A1").Formula "=VLOOKUP(" & strLookValue(intLookNum) &
",Setup!A1:A15,2,FALSE)"

I am trying to add a variable from an array to the VLOOKUP formula.

/Sune


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Vaiable in range().formula

Dave Peterson wrote:
I bet you have to increase the number of columns in your lookup range, too.

A1:B15????

Hi Dave,

Well, yes it would be hard pressed to find the second row in my range,
wouldn't it? The formula was not exactly a copy-paste job from the
actual code.

Sharp eyes!

/Sune


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
use vaiable for all sheets R..VENKATARAMAN Excel Programming 5 October 4th 06 04:50 AM
vaiable colours for selection in chart NoelH Charts and Charting in Excel 4 October 27th 05 04:43 AM
Assign vaiable to a cell - gold gold gold via OfficeKB.com Excel Worksheet Functions 1 June 4th 05 04:31 AM
Clearing a date vaiable PSKelligan Excel Programming 0 April 27th 05 11:39 PM
Clearing a date vaiable Alok Excel Programming 1 April 27th 05 10:21 PM


All times are GMT +1. The time now is 09:23 AM.

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

About Us

"It's about Microsoft Excel"