Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
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
formula to count sets of repeating numbers Excel-User-RR Excel Worksheet Functions 6 February 16th 09 06:14 PM
Find all possible Difference between two sets of numbers Jason Excel Worksheet Functions 1 January 24th 07 05:45 PM
parsing a string for 3 sets of numbers Micah Excel Programming 6 May 31st 06 07:03 PM
How to count sets of numbers JimDandy Charts and Charting in Excel 2 March 29th 06 10:45 PM
Loop and transpose sets of data Sach Excel Programming 2 January 31st 06 07:17 AM


All times are GMT +1. The time now is 04:10 PM.

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"