LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 155
Default Selecting more than 1 named range

Hi Gary's Student,

That works!

Thank you so much
--
Diddy


"Gary''s Student" wrote:

This assumes that the Names have already been assign in the worksheet:

Sub zeroThem()
Set r = Union(Range("myRange1"), Range("myRange2"))
On Error Resume Next
r.SpecialCells(xlBlanks).Value = 0
On Error GoTo 0
End Sub

You do not need to either GoTo the cells or Select the cells.
--
Gary''s Student - gsnu200834


"Diddy" wrote:

Hi,

I'm trying to add zeroes to blank cells in ranges to make them contiguous.

I have named the ranges and used the macro recorder to select the range
which gives me

Application.Goto Reference:="MyRange1"
On Error Resume Next
Selection.SpecialCells(xlBlanks).Value = 0
On Error GoTo 0

This works fine, but how can I alter it to select a number of non-contiguous
at the same time.

Could anyone also explain the difference between Select and the
Application.Goto Reference please.

Many thanks



--
Diddy

 
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
selecting a named range based on a cell value WimR Excel Programming 1 August 2nd 07 09:07 PM
Selecting specific row/column from a named range [email protected] Excel Worksheet Functions 2 November 16th 05 09:24 PM
Problem selecting a named range kkknie[_180_] Excel Programming 0 August 11th 04 08:30 PM
Selecting/Printing a Named Range via VBA Diane M Excel Programming 0 April 23rd 04 06:51 PM
Selecting Filtered Items from Named range Soniya Excel Programming 2 August 20th 03 10:59 AM


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