Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using vlookup in a loop
Basically I have 2 sheets, "invoice" and "data".
I'm pulling data out of the data sheet and populating fields in the invoice. I've been using vlookup to pull the data from the "data" sheet, populate the invoice using the vlookup, do stuff with the invoice sheet (which i've built a macro for already), and then I'd manually increase the target value by one to go onto the next row. I need a macro that will loop by adding +1 to the target value in my vlookup formula and keep looping until there are no rows left. Alternatively it'd be useful if a dialogue box would let the user tell the macro where to start and end with the loop...if that's feasible. any suggestions? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using vlookup in a loop
On Fri, 19 Sep 2008 12:11:01 -0700, chrismv48
wrote: Basically I have 2 sheets, "invoice" and "data". I'm pulling data out of the data sheet and populating fields in the invoice. I've been using vlookup to pull the data from the "data" sheet, populate the invoice using the vlookup, do stuff with the invoice sheet (which i've built a macro for already), and then I'd manually increase the target value by one to go onto the next row. I need a macro that will loop by adding +1 to the target value in my vlookup formula and keep looping until there are no rows left. Alternatively it'd be useful if a dialogue box would let the user tell the macro where to start and end with the loop...if that's feasible. any suggestions? Please give some more information to make it easier to help: 1) What does your VLOOKUP statement look like right now 2) What do you mean by "target value" 3) What do you mean by "there are no rows left" Lars-Åke |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
using vlookup in a loop
Okay I'm trying to set a user defined range to use in VLOOKUP. So for
starters, I'd like the user to select the range, then to have that range used in the vlookup formula that's already stored in a cell, E3. That way the user can decide what he/she wants to use as data. Once that vlookup range is set, to let's say A1:B10 by the user, we need to have a loop run that will increment the target cell each time. example: -the formula in cell E3 starts as "=VLOOKUP(C$10$,UserRange,5,False)" -at this point i have another macro to do other things, and at completion the loop starts over so the target cell used in VLOOKUP (C10) will need to interate by +1 until the last row in UserRange is reached...so if currently cell C10 reads: =July!A10 'the loop would add to the range each time by 1. So: =July!A11 =July!A12 =July!A13 Until it reaches the end of the Vlookup range. Sorry if that was confusing--I realize now that the way I explained it initially was inaccurate. "Lars-Ã…ke Aspelin" wrote: On Fri, 19 Sep 2008 12:11:01 -0700, chrismv48 wrote: Basically I have 2 sheets, "invoice" and "data". I'm pulling data out of the data sheet and populating fields in the invoice. I've been using vlookup to pull the data from the "data" sheet, populate the invoice using the vlookup, do stuff with the invoice sheet (which i've built a macro for already), and then I'd manually increase the target value by one to go onto the next row. I need a macro that will loop by adding +1 to the target value in my vlookup formula and keep looping until there are no rows left. Alternatively it'd be useful if a dialogue box would let the user tell the macro where to start and end with the loop...if that's feasible. any suggestions? Please give some more information to make it easier to help: 1) What does your VLOOKUP statement look like right now 2) What do you mean by "target value" 3) What do you mean by "there are no rows left" Lars-Ã…ke |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Vlookup and print loop | Excel Programming | |||
loop and vlookup | Excel Programming | |||
Add loop to Vlookup | Excel Programming | |||
Need a vb loop for vlookup | Excel Programming | |||
Need a vb loop for vlookup | Excel Programming |