Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Since you didn't give anything about your data structure I wrote this macro that will handle any case. I don't know which columns contain data. this macro only looks at the last row of data and not for blanks in the middle of the data. You request for number of USED ROWS which could mean a few different things. Sub BlankRows() Sht1LastRow = 0 Sht2LastRow = 0 For ColCount = 1 To Columns.Count LastRow = Sheets("Sheet1").Cells(Rows.Count, ColCount).End(xlUp).Row If LastRow Sht1LastRow Then Sht1LastRow = LastRow End If LastRow = Sheets("Sheet2").Cells(Rows.Count, ColCount).End(xlUp).Row If LastRow Sht2LastRow Then Sht2LastRow = LastRow End If Next ColCount If Sht1LastRow < Sht2LastRow Then If Sht1LastRow Sht2LastRow Then MsgBox ("Sheet2 has (blank) number") Else MsgBox ("Sheet1 has (blank) number") End If Response = MsgBox("Do you want to proceed", vbYesNo) If Response = vbNo Then Exit Sub End If End Sub -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161620 Microsoft Office Help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Inserting a number of rows based on the number of columns filled bytext values | Excel Programming | |||
Fill Cells with same number in three rows then skip to next number | Excel Worksheet Functions | |||
Get number of rows that data uses, including blank rows | Excel Discussion (Misc queries) | |||
Get number of rows that data takes up, including blank rows | Excel Worksheet Functions | |||
flexible paste rows function that inserts the right number of rows | Excel Discussion (Misc queries) |