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: 407
Default range names in macros - syntax again

I have some macro code that hides a certain range of rows (220 to 228).
However, occasionally, a few rows get added in the middle, which messes up
the macro. I think I know that, if I name the range (I did as
"net.profit.rows.on.ProjectCF" though the macro keeps changing some of the
letters to upper case), and use the range name in the macro, it will adjust
for such changes automatically. The first row of code works fine. The
second one, my feeble attempt at the aforementioned fix, doesn't. Please
tell me how to get this range name to be hidden, in the Else condition. If
I need to dimension something too, let me know, please. Thx. Dean

If ProfitMode = "Net Profit %" Then Rows("160:208").Hidden = True
Else Rows("200:228").Hidden = True

If ProfitMode = "Net Profit %" Then Rows("160:208").Hidden = True Else
net.profit.Rows.On.ProjectCF.Hidden = True


 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
version differences in excel 2007 - use of macros & range names difinity Excel Discussion (Misc queries) 1 May 12th 10 01:36 PM
Range names in macros - DA Dean[_8_] Excel Programming 4 October 26th 06 11:01 PM
Range names in a Excell macros karene Excel Programming 6 January 11th 06 12:55 PM
Syntax in Varying Object Names Marty Excel Programming 1 December 15th 05 06:58 PM
Names.Add - Range Syntax Issue Arturo Excel Programming 4 April 22nd 05 04:04 PM


All times are GMT +1. The time now is 12:14 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"