Ranges

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All -

I have two columns; Range1 and Range2 respectively. If for example, Range1
has a value of 20 and Range2 has a value of 44 - I need to take all the
values between those two and put them into a new worksheet so it will have
one column that has 20, 21, 22, 23, 24 etc. as the records. It then needs to
go to the next row in Sheet 1 - and look at the Range1 and Range2 and
transpose all those values in the new worksheet.

Can anybody advise?

Thanks!
 
set sh = Activesheet
Application.DisplayAlerts = False
On Error Resume Next
Worksheets("Output").Delete
On Error goto 0
Application.DisplayAlerts = True
Worksheets.Add
Activesheet.Name = "Output"
set sh1 = Worksheets("Output")
sh.Activate
lOff = Range2.Column - Range1.Column
rw = 1
for each cell in Range1
lStart = cell.Value
lStop = cell.offset(0,lOff).Value
for i = lStart to lStop
sh1.cells(rw,1).Value = i
rw = rw + 1
Next
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top