Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
add the indicated line:
RowCount = 1 NewRow = 1 Do While Range("A" & RowCount) < "" FirstNum = Range("A" & RowCount) LastNum = Range("B" & RowCount) IF LastNum= 0 then LastNum = FirstNum 'ADD THIS For i = FirstNum To LastNum Range("C" & NewRow) = i NewRow = NewRow + 1 Next i RowCount = RowCount + 1 Loop "tom" wrote in message ... The below coding working fine but if b1 is blank in this case c1 should display A1 like below.Please suggest. A1 B1 C1 19 20 19 25 20 25 "Joel" wrote: Sub GetNumbers() RowCount = 1 NewRow = 1 Do While Range("A" & RowCount) < "" FirstNum = Range("A" & RowCount) LastNum = Range("B" & RowCount) For i = FirstNum To LastNum Range("C" & NewRow) = i NewRow = NewRow + 1 Next i RowCount = RowCount + 1 Loop End Sub "tom" wrote: I have 2 columns A,B with values; i have to list out the values between A1,B1 including A1, B1 after that it should move to row2.....so on.I have to get the answer the which is mentioned in C column. Please suggest. I tried but inner loop is not working for me. A B C 4 7 5 9 11 6 19 21 7 53 59 9 61 65 10 11 19 20 21 53 54 59 61 62 63 64 65 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enhance sub to copy cols of variable length into 1 col to snake results into other cols | Excel Programming | |||
Change code to popualte into cols D,E, & F instead of A,B, & C | Excel Programming | |||
2 Cols To 2 Cols VLookup Comparison | Excel Discussion (Misc queries) | |||
Range.Select 1st pass 13 cols, 2nd paqss 25 cols twice as wide in error? | Excel Programming | |||
Cond Format:re color 2 cols, skip 2 cols | Excel Worksheet Functions |