View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Create named range of cells with values in row

This might be more than you need, but it assigns the name and then tests to
make sure that it took.

Sub dk()
Dim lc As Long, rng As Range
lc = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
Set rng = ActiveSheet.Range("B1", ActiveSheet.Cells(1, lc))
rng.Name = "myRange"
Range("myRange").Interior.ColorIndex = 3
End Sub




"CLR" wrote in message
...
Hi All.......
I need help please to create a Named Range of all the cells with values
therein starting at cell B1 and continuing through all contigunious cells
with values to the right in the same row only. If there be a broken
column,
then all cells to the right of that break need not be included.

Tks,
Vaya con Dios,
Chuck, CABGx3