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: 6
Default Vlookup - Issue....

Hi,

I need help....

I have a worksheet which looks like this...

StoreNo--- 201 202 203

Week 1 X

Week 2 y

Week 3 z



I have two combobox's on main sheet where users can select Week's and Store
numbers.

So say I can select Week 1 and Store 201.

Once users have selected these two variables , they click on a button and
the corresponding data should be populated in a textbox . So when I click the
button , the output in textbox should be 'X' for above example.

I have the following code in button click event:

Dim strStoreNumber As String
Dim strAccountWeek As String
Dim rngLookup As Range
Dim varVlookupVarient As Variant

Private Sub CommandButton1_Click()

strStoreNumber = ComboBox1.Value
strAccountWeek = ComboBox2.Value

Set rngLookup =
Application.Workbooks("POS.xls").Worksheets("Sheet 1").Range("A:DW")

' this doesnt work....
varVlookupVarient = Application.VLookup(strAccountWeek, rngLookup,
ComboBox1.Value, False)

' Below line works but I need the column in Vlookup to be dynamically
selected.....
'varVlookupVarient = Application.VLookup(strAccountWeek, rngLookup, 2, False)

MsgBox ("This is what you get" & varVlookupVarient)
' Once I get this data right, I can then have this as TextBox.value.

End Sub


Please help.....

I am not sure if I am doing this right...is there another way instead of
using Vlookups...

Regards
Veeraan

 
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
vlookup issue Connor Doyle Excel Worksheet Functions 2 February 4th 10 01:52 AM
Issue with VLOOKUP armsiee Excel Worksheet Functions 3 January 31st 09 12:52 AM
Vlookup issue [email protected] Excel Discussion (Misc queries) 6 August 8th 08 07:57 PM
Vlookup issue [email protected] Excel Discussion (Misc queries) 1 January 23rd 08 03:53 PM
Vlookup issue [email protected] Excel Programming 1 May 17th 07 02:40 PM


All times are GMT +1. The time now is 01:59 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"