LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default equal size columns [same no. of rows]

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
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
Columns of Equal Size Templar Excel Discussion (Misc queries) 3 October 14th 08 04:02 AM
Zoom size doesn't equal print size vinceh Excel Discussion (Misc queries) 2 August 13th 08 12:03 AM
Hide rows when specified columns equal zero Han123 Excel Discussion (Misc queries) 1 June 7th 08 04:31 AM
Turning rows of equal number of columns into 1 continuous row chimerical Excel Worksheet Functions 1 December 7th 06 09:45 PM
set number of rows equal in mutiple columns speary Excel Discussion (Misc queries) 5 July 8th 05 12:27 AM


All times are GMT +1. The time now is 02:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"