LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default Else without if?

More code, this time getting an "Else without if" error at the else
line!

Range("a1").Select
Set TtlRng = Range(Selection, Selection.End(xlToRight))
For Each rFoundHd In TtlRng.Cells
If Right(rFoundHd.Value, 2) = "ID" Then
ActiveSheet.Range(rFoundHd,
rFoundHd.End(xlDown)).Select
With Selection
.HorizontalAlignment = xlRight
.NumberFormat = "@"
Else
Next rFoundHd
End If

Sure looks like an "If" to me, 6 lines above the else!
rFoundHd is declared as a range, as is TtlRng.
The code is supposed to look in row 1 for any header ending in "ID".
When it finds one, it should format that column to text and right align
it. Then move to the next cell in row 1.
Any suggestions?
Thanks in advance.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"