Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have been at my wits end with this strange problem. I keep getting a 1004 run-time error for the following piece of code although I dont see anything wrong in the way I've written it. I need to get the number of filled rows in both sheets 1 and 2. I am running this macro on a command button in Sheet2. And the error occurs at the line row_count1 = Worksheets(1).Range(Cells(1, 1), Cells (1, 1).End(xlDown)).Rows.Count If I skip that line, the row_count2 line executes perfectly fine. Both the statements are very similar, yet I get the error. :( Can someone please suggest some solutions? Dim row_count1 As Integer Dim row_count2 As Integer Dim split_text() As String Dim x As Integer Dim No_Of_Elements As Integer Worksheets(1).Activate row_count1 = Worksheets(1).Range(Cells(1, 1), Cells(1, 1).End (xlDown)).Rows.Count Worksheets(2).Activate row_count2 = Worksheets(2).Range(Cells(3, 1), Cells(3, 1).End (xlDown)).Rows.Count Thanks, Satish |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Run Time Error 1004: Application or Object Defined Error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Run time error '1004': Generaol ODBC error | Excel Programming |