Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop thru two sets of numbers
I am new to VBA, basically I record macros/get help here and then manipulate
the code until it works. I have a macro written to input data into certain cells. The user inputs the sku # and then inputs the location #, and then the macro is fired. I have a set list with one hundred skus, and twenty location numbers. What I would like to do is have Excel look at the first sku number (13328960) and run the process for each of the twenty locations (161, 181, 182, etc, etc). Once done with the twenty locations, then go to the next sku number (13328978) and repeat the process until there are no more sku numbers. 161 181 182 188 13328960 13328978 13328994 13329001 I appreciate any direction that you can give, whether sample code or references to review. Many thanks Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Loop thru two sets of numbers
Dim rng as Range, rng1 as Range
dim cell as Range, cell1 as Range set rng = range(cells(2,1),cells(2,1).End(xldown) for each cell in rng rng1 = cell.offset(0,1).Resize(1,20) for each cell1 in rng1 cell1.activate loc = cells(1,cell1.column) sku = cell.value ' run macro next next -- Regards, Tom Ogilvy "jeffbert" wrote: I am new to VBA, basically I record macros/get help here and then manipulate the code until it works. I have a macro written to input data into certain cells. The user inputs the sku # and then inputs the location #, and then the macro is fired. I have a set list with one hundred skus, and twenty location numbers. What I would like to do is have Excel look at the first sku number (13328960) and run the process for each of the twenty locations (161, 181, 182, etc, etc). Once done with the twenty locations, then go to the next sku number (13328978) and repeat the process until there are no more sku numbers. 161 181 182 188 13328960 13328978 13328994 13329001 I appreciate any direction that you can give, whether sample code or references to review. Many thanks Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
formula to count sets of repeating numbers | Excel Worksheet Functions | |||
Find all possible Difference between two sets of numbers | Excel Worksheet Functions | |||
parsing a string for 3 sets of numbers | Excel Programming | |||
How to count sets of numbers | Charts and Charting in Excel | |||
Loop and transpose sets of data | Excel Programming |