Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Range naming cells with blank cells through coding

Hi,

Through macro, how do I name a range which consists of blank cells in
between. The range will be derived dynamically, where only the starting cell
is known. For example, Range starts frm A5, and end cell should be selected
dynamically based on the data. In between the dynamic range there may be some
blank cells. How to I code?

Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Range naming cells with blank cells through coding

The following will create a Named range of the empty cells below A5 until a
non-empty cell is found:

Sub servient()
Set a5 = Range("A5")
s = "=Sheet1!$A$6:$A$" & a5.End(xlDown).Row - 1
ActiveWorkbook.Names.Add Name:="bigji", RefersTo:=s
End Sub

--
Gary''s Student - gsnu200776


"Naveen J V" wrote:

Hi,

Through macro, how do I name a range which consists of blank cells in
between. The range will be derived dynamically, where only the starting cell
is known. For example, Range starts frm A5, and end cell should be selected
dynamically based on the data. In between the dynamic range there may be some
blank cells. How to I code?

Thanks in advance

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
If certain cells not blank, and cells in range are, set values to ktoth04 Excel Discussion (Misc queries) 0 February 21st 08 09:01 PM
Maximum Number of Blank Cells between Non Blank Cells in a Range Mal Excel Worksheet Functions 5 November 3rd 07 08:21 AM
Naming a non-blank range from a col containing non-consec. blank c fruitticher Excel Worksheet Functions 3 September 14th 07 11:49 PM
Will excel add cells using colour coding eg Add all red cells Wildwoody Excel Discussion (Misc queries) 4 October 21st 05 01:02 AM
How do I skip blank cells when copying over a range of cells? tawells Excel Discussion (Misc queries) 2 June 7th 05 09:36 PM


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