LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Assign a range-name from B2 to {end of data}


I've searched all of the discussion sub-groups and can't find a solution for
this.
I want to Assign a range-name from B2 to {end of data} so I can perform a
for-each-cell next-cell loop.

My spreadsheet is exported from another application that I have no control
over [isn't that always the case !!]

Each export has contiguous [no spaces] data in up to 1000 rows and up to 15
columns. Each run is quite different. Some data cells [B2:end] may be blank.
Even the last cell in the bottom-right corner may be blank.

GoTo Special Current Region seens to catch all the data but also
includes column A and row 1 ...

For example with data in A1 to E10 I want to name the range B2:E10
NOTE: Not from A1 because I don't want the range to include Row 1 or Column A

Also, FYI, after the last data there are 4 blank lines and then several
summary rows in [for example: A15 to A20] CTRL + SHIFT + END catches them.

How do I range-name the SELECTION from B2 to the end-of-data [E10 in above]
so this code works to cycle through all the data cells.

Dim Cell As Range
For Each Cell In SELECTION
If Not IsEmpty(Cell) Then
' code for each cell here
End If
Next Cell

--
Thanks for your reply & assistance.
Jimbo213
 
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
How do I assign a letter value to a range of data? clatters69 Excel Discussion (Misc queries) 1 September 16th 06 05:55 PM
assign value to range Justin Excel Programming 8 May 18th 06 09:37 PM
Assign number to every value in a data range??? the dude Excel Worksheet Functions 1 May 16th 06 08:41 PM
Assign a Name to a Range in VBA Gary''s Student Excel Programming 5 March 22nd 06 06:10 PM
assign a value to a range travelersway Excel Discussion (Misc queries) 7 November 2nd 05 03:16 PM


All times are GMT +1. The time now is 09:11 AM.

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"