Thread: code error
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
keri keri is offline
external usenet poster
 
Posts: 74
Default code error

I can't understand what i am doing wrong with this code. Obviously the
first part of the code is for all sheets named "cardata" & integer.
After this first part I want to select "a1" in these sheets to run the
code that follows. However my line starting Range causes an error.

Dim ws As worksheet
For Each ws In ActiveWorkbook.Worksheets
If UCase(Left(ws.Name, 7)) = "CARDATA" Then
If IsNumeric(Right(ws.Name, Len(ws.Name) - 7)) Then
Range("a1").Select

I would appreciate help but also an explanationa s to why I can't start
this line of code with Range.

Thanks.