Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
associates
 
Posts: n/a
Default hiding column using VB


Hi,

How do i hide columns in worksheets?

I have the following code,
Private Sub CM_Filtergroup_Click()
Beep
' clears the formulas and formatting in cells A1:G37 on "Data"
Worksheets("Data").Unprotect
Worksheets("Data").Range("A1:S200").Clear
Worksheets("Data").Column("D:E").EntireColumn.Hidd en = True
ImportCSVgroup
End Sub

The above code gives me an error message saying

runtime error '438'
Object doesn't support this property or method

Need your help.

Thank you in advance


--
associates
------------------------------------------------------------------------
associates's Profile: http://www.excelforum.com/member.php...o&userid=35073
View this thread: http://www.excelforum.com/showthread...hreadid=548469

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Norman Jones
 
Posts: n/a
Default hiding column using VB

Hi Associates,

Tty changing:

Worksheets("Data").Column("D:E").EntireColumn.Hidd en = True


to

Worksheets("Data").Column("D:E").EntireColumns.Hid den = True


(Note the final 's' in Columns)

---
Regards,
Norman



"associates" wrote
in message ...

Hi,

How do i hide columns in worksheets?

I have the following code,
Private Sub CM_Filtergroup_Click()
Beep
' clears the formulas and formatting in cells A1:G37 on "Data"
Worksheets("Data").Unprotect
Worksheets("Data").Range("A1:S200").Clear
Worksheets("Data").Column("D:E").EntireColumn.Hidd en = True
ImportCSVgroup
End Sub

The above code gives me an error message saying

runtime error '438'
Object doesn't support this property or method

Need your help.

Thank you in advance


--
associates
------------------------------------------------------------------------
associates's Profile:
http://www.excelforum.com/member.php...o&userid=35073
View this thread: http://www.excelforum.com/showthread...hreadid=548469



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Norman Jones
 
Posts: n/a
Default hiding column using VB

Hi Associates,

Trying again(!)

Change:

Worksheets("Data").Column("D:E").EntireColumn.Hidd en = True


to

Worksheets("Data").Columns("D:E").EntireColumns.Hi dden = True


(Note the final 's' in Columns)


---
Regards,
Norman


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Norman Jones
 
Posts: n/a
Default hiding column using VB


Hi Associates,

I thought that I had omitted the final 's', but I now see that it was
inadvertently added to the second instance of 'Column'.

The correct syntax is:

Worksheets("Data").Columns("D:E").EntireColumn.Hid den = True


---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
associates
 
Posts: n/a
Default hiding column using VB


Hi Norman,

Thank you for your reply.

Yes, it got rid of the error message there. Thanks for that

However, it doesn't hide the columns D and E.

Is there anything i missed out here?

Thank you in advance


--
associates
------------------------------------------------------------------------
associates's Profile: http://www.excelforum.com/member.php...o&userid=35073
View this thread: http://www.excelforum.com/showthread...hreadid=548469



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
associates
 
Posts: n/a
Default hiding column using VB


Hi, Norman

Sorry, it works now. So please disregard my previous post.

Thank you for your help. :)


--
associates
------------------------------------------------------------------------
associates's Profile: http://www.excelforum.com/member.php...o&userid=35073
View this thread: http://www.excelforum.com/showthread...hreadid=548469

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
Column picked randomly with probability relative to number of entr Neil Goldwasser Excel Worksheet Functions 4 May 30th 06 08:55 AM
how can i multiply two columns edgar Excel Worksheet Functions 7 March 2nd 06 03:29 PM
Positioning Numeric Values Resulting from 6 Column Array Formula Sam via OfficeKB.com Excel Worksheet Functions 2 January 5th 06 02:03 AM
How to group similar column titles together???? vrk1 Excel Discussion (Misc queries) 2 April 30th 05 12:17 AM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 07:52 AM.

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"