Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi! sorry i didn't get back to you yesterday - i was out sick........
i am still sick today & my brain is not working quite good enough, and i can't make this stupid thing work................. i couldn't make 2 "for-each" loops work inside each other, so i made the 2nd loop into a different sub. maybe somebody else can help you get it working??? :P sorry! susan '====================== Option Explicit Sub fill_all_rows() Dim col As Integer Dim myCol As Range Dim c As Range Dim ic As Integer Dim iLastRow As Integer Dim rmyRange As Range Dim ws As Worksheet Set ws = ActiveSheet Set rmyRange = ws.Range("a1:f15") 'for instance Set myCol = ws.Cells(, 1) For Each myCol In rmyRange Call loop_columns Next myCol End Sub '========================== Sub loop_columns() Dim col As Integer Dim myCol As Range Dim rCell As Range Dim r As Long Dim ic As Integer Dim iLastRow As Integer Dim rmyRange As Range Dim ws As Worksheet ic = 1 For Each rCell In myCol r = rCell.Row Do Until r = 16 If rCell < "" Then 'do nothing Else rCell = rCell.Offset(-1, 0).Value 'might need to be c.value = 'c.Offset(-1, 0).Value End If Loop Next rCell End Sub '======================== On May 9, 1:42 pm, wrote: thanks susan for ur time n quick reply but actually the code u mentioned woked only in case of 2 columns in which col1 col2 but in my case many columns are there and i mean we hav to "redim" the size of our range i have to compare two adjacent columns and count whichevr have greater number of rows between two adjacent column then i hav to make small size column should b equal to longer column hope i hav made it clear plz let me knw if i havnot frmed it properly many thanx for ur time n sugeestions |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Columns of Equal Size | Excel Discussion (Misc queries) | |||
Zoom size doesn't equal print size | Excel Discussion (Misc queries) | |||
Hide rows when specified columns equal zero | Excel Discussion (Misc queries) | |||
Turning rows of equal number of columns into 1 continuous row | Excel Worksheet Functions | |||
set number of rows equal in mutiple columns | Excel Discussion (Misc queries) |