Runtime Error '1004'

  • Thread starter Thread starter slingsh0t
  • Start date Start date
S

slingsh0t

I'm running some code that declares rCell as a Range and steps through
a sheet using
For Each rCell in ActiveSheet.UsedRange

I encountered runtime error 1004, Unable to set HorizontalAlignment
property of the Range class.

Any thoughts as to why this is happening? Thanks!
 
I'm running some code that declares rCell as a Range and steps through
a sheet using
For Each rCell in ActiveSheet.UsedRange

I encountered runtime error 1004, Unable to set HorizontalAlignment
property of the Range class.

Any thoughts as to why this is happening? Thanks!

I'm going to take a blind stab, solely because I'm too tired to go
write the code to check it..

Is it possible you need to select a cell or a range prior to using
that?

MP-
 
Hi, Mangus-
Thanks for your response. Here's the long version of the story: as you
may know Excel can generate a "Too many cell formats" error in a
formatting-intensive sprdsht. I've written some code to go thru the
back office tabs of this workbook and reset formats to generic.

Can't explain why, but when I closed Excel and reopened the same
workbook the code runs fine. And you're right, it's too late and I'm
too tired to fuss with it any longer. I'm willing to chalk it up to
some kind of memory... uh... flux capacitor problem.

Thanks again for your come-back!
 
Back
Top