Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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) "Erin Simons" <Erin wrote in message ... 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... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 "Chip Pearson" wrote: 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) "Erin Simons" <Erin wrote in message ... 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... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
Help: Compile error: type mismatch: array or user defined type expected | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |