Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Need some help with Resize. Thanks

I have written this procedure to hide a block of rows. All of the statements
work except the ".Resize" statement. If I take it out and replace it with
".Select," the correct rows are selected and hidden.

Dim ws As Worksheet
Dim strPubListRN As String, strQuestListRN As String
Dim namPList As Name, namQlist As Name
Dim rngToHide As Range
Dim numRowsToHide As Long
Set ws = ActiveSheet
Set namPList = Names("PubList")
Set namQlist = Names("QuestList")
Set rngToHide = ws.Range(ws.Range(namQlist),
ws.Range(namPList)).EntireRow
numRowsToHide = rngToHide.Rows.Count - 1
With rngToHide
.Resize(numRowsToHide)
.Hidden = True
End With

But when I reintroduce the ".Resize" statement, I get an error "Invalid use
of the property Resize."

What is wrong?

John Wirt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need some help with Resize. Thanks


With rngToHide
.Resize(numRowsToHide).Entirerow.Hidden = True
End With



Regards,
Tom Ogilvy

John Wirt wrote in message
...
I have written this procedure to hide a block of rows. All of the

statements
work except the ".Resize" statement. If I take it out and replace it with
".Select," the correct rows are selected and hidden.

Dim ws As Worksheet
Dim strPubListRN As String, strQuestListRN As String
Dim namPList As Name, namQlist As Name
Dim rngToHide As Range
Dim numRowsToHide As Long
Set ws = ActiveSheet
Set namPList = Names("PubList")
Set namQlist = Names("QuestList")
Set rngToHide = ws.Range(ws.Range(namQlist),
ws.Range(namPList)).EntireRow
numRowsToHide = rngToHide.Rows.Count - 1
With rngToHide
.Resize(numRowsToHide)
.Hidden = True
End With

But when I reintroduce the ".Resize" statement, I get an error "Invalid

use
of the property Resize."

What is wrong?

John Wirt




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Need some help with Resize. Thanks

Tom,
Thanks for responding. It works. Can you explain why it works?
Thank you.
John

"Tom Ogilvy" wrote in message
...

With rngToHide
.Resize(numRowsToHide).Entirerow.Hidden = True
End With

Regards,
Tom Ogilvy

John Wirt
I have written this procedure to hide a block of rows. All of the

statements
work except the ".Resize" statement. If I take it out and replace it

with
".Select," the correct rows are selected and hidden.

Dim ws As Worksheet
Dim strPubListRN As String, strQuestListRN As String
Dim namPList As Name, namQlist As Name
Dim rngToHide As Range
Dim numRowsToHide As Long
Set ws = ActiveSheet
Set namPList = Names("PubList")
Set namQlist = Names("QuestList")
Set rngToHide = ws.Range(ws.Range(namQlist),

ws.Range(namPList)).EntireRow
numRowsToHide = rngToHide.Rows.Count - 1
With rngToHide
.Resize(numRowsToHide)
.Hidden = True
End With

But when I reintroduce the ".Resize" statement, I get an error "Invalid
use of the property Resize."

What is wrong?

John Wirt




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
Charts resize themselves WillV Charts and Charting in Excel 0 December 12th 08 03:51 AM
Add comment and resize it jlclyde Excel Discussion (Misc queries) 2 October 22nd 08 09:47 PM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 4 June 6th 06 04:46 AM
I could NOT resize the axis title but excel allows me to resize gr Iwan Setiyono Ko Charts and Charting in Excel 0 March 15th 06 10:34 AM
Resize name box Dave Peterson Setting up and Configuration of Excel 0 January 19th 05 01:01 AM


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