![]() |
1004 error
Hi All i get the 1004 error msg when the code enters: Worksheets("Paydata
Import File Sample").Range("D1").Select Im using excel2003. I've tried to see other threads but in vain. Any thoughts? Private Sub Worksheet_Activate() Dim i As Integer Application.ScreenUpdating = False Worksheets("Paydata Import File Sample").Range("D1").Select Do If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then i = i + 1 End If ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Value = "" Sheets("Statistics").Select Range("C1").Value = i Application.ScreenUpdating = True End Sub |
1004 error
Hi Lp12,
My apologies - I had inadvertently changed my date setting! --- Regards, Norman |
1004 error
Hi Norman, Thanks for you answer. How exaclty can i avaoid selection? can you give me an example? Thanks a lot "Norman Jones" wrote: Hi Lp12, Without otherwise looking at your code, selections can only be made on the active sheet. Therefore, either activate the required sheet or, preferably, rewrite your code to avoid selections. --- Regards, Norman "Lp12" wrote in message ... Hi All i get the 1004 error msg when the code enters: Worksheets("Paydata Import File Sample").Range("D1").Select Im using excel2003. I've tried to see other threads but in vain. Any thoughts? Private Sub Worksheet_Activate() Dim i As Integer Application.ScreenUpdating = False Worksheets("Paydata Import File Sample").Range("D1").Select Do If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then i = i + 1 End If ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Value = "" Sheets("Statistics").Select Range("C1").Value = i Application.ScreenUpdating = True End Sub |
All times are GMT +1. The time now is 10:37 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com