Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Stupid Syntax Question

Hi,

silly syntax question....

these statements work...

Sheets("Yr Summary - Chart").Select
Columns("E:E").EntireColumn.Hidden = True
Sheets("Chart - Yr Forecast").Select

this for some reason doesn't...

Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True

what's wrong...??

Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Stupid Syntax Question

Hi Chris,

this for some reason doesn't...


Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True


The code works for me.

What error do you encounter?

---
Regards,
Norman



"Chris Gorham" wrote in message
...
Hi,

silly syntax question....

these statements work...

Sheets("Yr Summary - Chart").Select
Columns("E:E").EntireColumn.Hidden = True
Sheets("Chart - Yr Forecast").Select

this for some reason doesn't...

Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True

what's wrong...??

Chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Stupid Syntax Question

right...this has prompted a little investigation by me...

the code works fine as long as Sheets("Chart - Yr Forecast") - which is the
active sheet at the time the routine is called - is a worksheet...
however it isn't - its a chart, and then for some reason it fails.
all I'm doing is running a little code to hide a column of data whilst
looking at a chart - this has the effect of knocking out one of the years in
the chart.
Sheets("Chart - Yr Forecast") is the chart and Sheets("Yr Summary - Chart")
is a worksheet containing the data being plotted....

Suggestions welcome....Chris

"Norman Jones" wrote:

Hi Chris,

this for some reason doesn't...


Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True


The code works for me.

What error do you encounter?

---
Regards,
Norman



"Chris Gorham" wrote in message
...
Hi,

silly syntax question....

these statements work...

Sheets("Yr Summary - Chart").Select
Columns("E:E").EntireColumn.Hidden = True
Sheets("Chart - Yr Forecast").Select

this for some reason doesn't...

Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True

what's wrong...??

Chris




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Stupid Syntax Question

All of these work. Yours should as well.

Sheets("sheet7").Columns("e:e").EntireColumn.Hidde n = True

Sheets("sheet7").Columns(5).Hidden = True
Sheets("sheet7").Columns("e").Hidden = True
Sheets("sheet7").Range("e1").EntireColumn.Hidden = True

--
Don Guillett
SalesAid Software

"Chris Gorham" wrote in message
...
Hi,

silly syntax question....

these statements work...

Sheets("Yr Summary - Chart").Select
Columns("E:E").EntireColumn.Hidden = True
Sheets("Chart - Yr Forecast").Select

this for some reason doesn't...

Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True

what's wrong...??

Chris



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Stupid Syntax Question

Hi,

If the activesheet is a chart then you will need to change Columns to Range.

Sheets("Yr Summary - Chart").Range("E:E").EntireColumn.Hidden = True

this also works
Sheets("Yr Summary - Chart").columns(5).entirecolumn.hidden=true

Cheers
Andy

Chris Gorham wrote:
Hi,

silly syntax question....

these statements work...

Sheets("Yr Summary - Chart").Select
Columns("E:E").EntireColumn.Hidden = True
Sheets("Chart - Yr Forecast").Select

this for some reason doesn't...

Sheets("Yr Summary - Chart").Columns("E:E").EntireColumn.Hidden = True

what's wrong...??

Chris


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


Reply
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
big stupid question Wu Excel Discussion (Misc queries) 4 May 17th 08 05:33 PM
Probably a Stupid Question Paige Excel Discussion (Misc queries) 10 February 4th 08 06:52 PM
stupid question Kimberly New Users to Excel 4 May 18th 07 08:55 PM
Stupid Question mastermind Excel Worksheet Functions 1 August 5th 06 07:03 PM
Stupid, stupid question.... DS Excel Programming 3 September 25th 05 03:51 PM


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

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

About Us

"It's about Microsoft Excel"