COUNT-COUNT
, I have two worksheets open that are similar. What I need to know if there
is a formula which tells me if there is a difference in number of rows between the first and second sheet. |
COUNT-COUNT
Hi Rahcel, Please clarify you want the differnce in the number of filled rows in sheet 1 and sheet 2 right? By filled rows we here mean that there is data in any cell in these rows. right? Regards Ankur www.xlmacros.com On Dec 19, 3:15 pm, Rachel wrote: , I have two worksheets open that are similar. What I need to know if there is a formula which tells me if there is a difference in number of rows between the first and second sheet. |
COUNT-COUNT
Try this :
Sub countcount() ' gsnu 12_19_2006 Dim r1 As Range, r2 As Range Dim w1 As Worksheet, w2 As Worksheet Dim n1 As Long, n2 As Long Set w1 = Worksheets(Application.InputBox("enter sheetname:", Type:=2)) Set w2 = Worksheets(Application.InputBox("enter other name:", Type:=2)) Set r1 = w1.UsedRange Set r2 = w2.UsedRange n1 = r1.Rows.Count + r1.Row n2 = r2.Rows.Count + r2.Row MsgBox ("Difference in number of row is: " & (n2 - n1)) End Sub -- Gary's Student "Rachel" wrote: , I have two worksheets open that are similar. What I need to know if there is a formula which tells me if there is a difference in number of rows between the first and second sheet. |
COUNT-COUNT
Hi,
Yes you have it right, is it possible to provide me with a formula that I can use? Many thanks, Rachel. "ankur" wrote: Hi Rahcel, Please clarify you want the differnce in the number of filled rows in sheet 1 and sheet 2 right? By filled rows we here mean that there is data in any cell in these rows. right? Regards Ankur www.xlmacros.com On Dec 19, 3:15 pm, Rachel wrote: , I have two worksheets open that are similar. What I need to know if there is a formula which tells me if there is a difference in number of rows between the first and second sheet. |
All times are GMT +1. The time now is 04:30 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com