Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default vlookup to select sheet

need help, trying to use vlookup on a simple table to find sheet/tab name, go
to that tab, drop in some data, and then return to table. any help greatly
appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default vlookup to select sheet

We need a little more detail on where things are located. VLookup may not be
the best way to do this. Perhaps an example of what you have now and what
you want it to look like. Is the data to drop in the LookUp table? Where
does the sheet name come from for VLookup to find? Where exactly do you want
the data dropped and do you want to append it or overwrite it? etc..etc.

Mike F
"mwam423" wrote in message
...
need help, trying to use vlookup on a simple table to find sheet/tab name,
go
to that tab, drop in some data, and then return to table. any help
greatly
appreciated!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default vlookup to select sheet

hi mike, thanks for reply. turns out i'm not using vlookup function, since
the table where i'm pulling information is pretty much fixed and is just
updated periodically, i'm using loop to go through table row by row. did end
up using "match" function to determine what row to place payment amount
within each tab. this seems to work, see VBA below: (sheet1 has the table
which has bloomburg formulas, behind sheet1 is a sheet for each account
listed in table. table has four columns: acct no., sheet name, pymt amount,
pymt date):

Sub Macro()

Sheets("sheet1").Activate

For i = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -1

Sheets("sheet1").Activate
Dim amt As Currency
amt = Cells(i, 3).Value

Dim date As Single
date = Cells(i, 4).Value

Dim sheetname As String
sheetname = Cells(i, 2).Value

Sheets(sheetname).Activate

Dim drop As Integer
drop = WorksheetFunction.Match(date, Range("b14:b114"), 1) + 13

Cells(drop, 3).Value = amt
Next i

End Sub

i'm novice in VBA and would appreciate any comments regarding above. oft
times i'm not aware of logic that is behind code, just pull it off discussion
board, tweak it until it works for what we need.

"Mike Fogleman" wrote:

We need a little more detail on where things are located. VLookup may not be
the best way to do this. Perhaps an example of what you have now and what
you want it to look like. Is the data to drop in the LookUp table? Where
does the sheet name come from for VLookup to find? Where exactly do you want
the data dropped and do you want to append it or overwrite it? etc..etc.

Mike F
"mwam423" wrote in message
...
need help, trying to use vlookup on a simple table to find sheet/tab name,
go
to that tab, drop in some data, and then return to table. any help
greatly
appreciated!




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
Alternate Row Select in Sheet 1 then Paste to Sheet 2 Steevo Excel Worksheet Functions 4 December 5th 08 06:45 PM
How do I select price from sheet.b where sheet.a part no = sheet.b Sonny Excel Worksheet Functions 4 April 4th 06 05:08 PM
Use Sheet CodeNames to Select Sheet in Different Workbook Randy Excel Discussion (Misc queries) 1 June 10th 05 12:17 AM
Macro, select Sheet "Number", NOT Sheet Name DAA Excel Worksheet Functions 4 November 30th 04 05:29 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM


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