Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inspecting cells in a row in a named range
Works great. (For anyone else using this, there is a trivial spelling error:
"Colummns." vice "Columns") thanks "Leith Ross" wrote in message ... Hello Jim, This examines the first and last rows of data. Code: -------------------- Dim FirstRow As Long Dim LastRow As Long Dim FirstColumn As Long Dim LastColumn As Long Dim DataCell As Range Dim FieldName As Name For Each FieldName In ThisWorkBook.Names If Not FieldName Is Nothing Then Set DataCell = Range(FieldName) With DataCell FirstRow = .Row LastRow = .Rows.Count - FirstRow + 1 FirstColumn = .Column LastColumn = .Colummns.Count - FirstColumn + 1 End With 'Examine First Row of Data For C = FirstColumn To LastColumn Debug.Print "cell: ", DataCell.Cells(FirstRow, C).Value Next C 'Examine Last Row of Data For C = FirstColumn To LastColumn Debug.Print "cell: ", DataCell.Cells(LastRow, C).Value Next C Endif Next FieldName -------------------- Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=484994 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Compare a selected Range with a Named range and select cells that do not exist | Excel Programming | |||
Populated Cells In A Named Range | Excel Programming | |||
Looping thru cells in a named range | Excel Programming |