LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 913
Default Macro to select cells at current cell

On Mon, 05 Jan 2009 20:01:41 GMT, Lars-Åke Aspelin
wrote:

On Mon, 05 Jan 2009 19:54:16 GMT, Lars-Åke Aspelin
wrote:

On Mon, 5 Jan 2009 11:39:02 -0800, cvgairport
wrote:

Hi there,

Can a VB macro be written to hide 3 rows at the cell position - no matter
where the current cell position is. I can write a macro to select specific
row numbers, but I want one that will take the 3 rows from the current cell.

Thanks!

Amy




Try this

Selection.Resize(3, 1).EntireRow.Hidden = True

This will hide the (top) row of the current selection together with
the two following rows.

Hope this helps / Lars-Åke


The above formula can be shortened a bit

Selection.Resize(3, 1).Rows.Hidden = True

Lars-Åke


Even shorter :-)

Selection.Resize(3).Rows.Hidden = True

Lars-Åke


 
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
VBA - Select: current cell + next 19 cells (down in column) = rang Chris T-M Excel Programming 2 November 7th 08 11:14 AM
Data: select a cell x rows below the current, where x is designate manxman Excel Discussion (Misc queries) 1 July 18th 06 05:32 PM
Macro €“ select all cells in current range Mary Ann Excel Discussion (Misc queries) 3 December 12th 05 07:19 AM
Macro to select cells within a range in which the cell color is none PCLIVE Excel Programming 9 October 18th 05 06:57 PM
Want macro to select current cell rdaugherty Excel Programming 9 October 13th 05 04:35 PM


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