ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Ranges (https://www.excelbanter.com/excel-programming/319167-ranges.html)

Mona

Ranges
 
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!


Tom Ogilvy

Ranges
 
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

--
Regards,
Tom Ogilvy

"Mona" wrote in message
...
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!





All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com