Type mismatch error - New to VB, please help

  • Thread starter Thread starter Erin Simons
  • Start date Start date
E

Erin Simons

My code is as follows. Please note that I can't get it to run past the first
line so I wouldn't be surprised if it is all be wrong!!

Sub Button2_Click()

Worksheets("Minutes").Activate
For Counter = 0 To UBound(Action1)
If Actions1.Text Then
Actions1.Copy
End If

Next Counter
End Sub

I get a "type mismatch" error on the line:
For Counter = 0 To UBound(Action1)
and i'm unsure what is wrong with it. Action1 is the name I have given to
my range (I just selected the range and named it). What am I doing wrong??

Thanks in Advance...
 
What is "Action1"? For UBound to work, it needs to be an array, but for Text
and Copy, it needs to be a range (I assume).


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Thanks Chip!! I'm very much a novice but your advice helped. A friend
suggested I use UBound, but I'm just using a For Each loop now, much better.

Thanks
E
 
Back
Top