Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Hide row from VBA

Hi,
I have situation like this :
In first column I have merged cells ( Merged cells =A1,A2).Colum B haven't
merged.I try thruog code hide row 2 but I hide row 1 and row 2.Here is my
code :

I=2
Row(i).Select
Selection.EntireRow.Hidden = True

Where is my mistaque ?
Thanks in advance


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Hide row from VBA

If cells in rows 1 and 2 are merged, hiding either row 1 or 2
will hide both row 1 and 2. There is no way around this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Marijan Glavac" wrote in message
...
Hi,
I have situation like this :
In first column I have merged cells ( Merged cells

=A1,A2).Colum B haven't
merged.I try thruog code hide row 2 but I hide row 1 and row

2.Here is my
code :

I=2
Row(i).Select
Selection.EntireRow.Hidden = True

Where is my mistaque ?
Thanks in advance




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hide row from VBA

Hi

This works for me.

I = 2
Columns(I).Select
Selection.EntireColumn.Hidden = True

Regards Ecc

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Hide row from VBA

hi Marijan

If the row or colum contains merged cells then they will be hidden, but if
you merge across column for row hide or merege across rows for column hide
then all rows are column will be hidden.

Your code should read

Rows(i).EntireRow.Hidden = True

Cheers
Nigel

"Marijan Glavac" wrote in message
...
Hi,
I have situation like this :
In first column I have merged cells ( Merged cells =A1,A2).Colum B haven't
merged.I try thruog code hide row 2 but I hide row 1 and row 2.Here is my
code :

I=2
Row(i).Select
Selection.EntireRow.Hidden = True

Where is my mistaque ?
Thanks in advance




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Hide row from VBA

A minor modification of your code worked for me in xl2002.

i = 2
Rows(i).Hidden = True

but this:
I=2
Rows(i).Select '<--added S to Row(s)
Selection.EntireRow.Hidden = True


behaved the way you described, too. Since you selected that row, it included
the merged cells.


What version of xl are you using?

Merged cells behavior has changed through different versions of excel.

I think that this is the way xl97 behaved with merged cells. And even the code
that worked for me wouldn't do what you wanted in xl97.





Marijan Glavac wrote:

Hi,
I have situation like this :
In first column I have merged cells ( Merged cells =A1,A2).Colum B haven't
merged.I try thruog code hide row 2 but I hide row 1 and row 2.Here is my
code :

I=2
Row(i).Select
Selection.EntireRow.Hidden = True

Where is my mistaque ?
Thanks in advance


--

Dave Peterson

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
How do you hide/un-hide the grid lines ED Excel Discussion (Misc queries) 4 February 26th 13 03:22 PM
Want to Hide columns in spreadsheet but NOT hide data in chart. KrispyData Charts and Charting in Excel 1 March 20th 09 04:45 PM
How do I hide hide #REF! in Excel PerryK Excel Discussion (Misc queries) 3 February 27th 09 02:59 PM
Hide Unhide Hide again DTTODGG New Users to Excel 1 February 15th 06 03:22 PM
How do I hide a worksheet in Excel and use a password to un-hide . Dchung Excel Discussion (Misc queries) 3 December 2nd 04 06:24 AM


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