View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default More on merged cells

Dim rng as Range, cell as Range
Dim offsetrw as long, offsetcol as long
set cell = Range("B9")
set rng = Range("B9").MergeArea
if rng.Count 1 then
offsetrw = cell.row - rng(1).row + 1
offsetcol = cell.column = rng(1).column + 1
msgbox " row offset: " & offsetrw & vbNewline & _
" column offset: " & offsetcol
End if

--
Regards,
Tom Ogilvy


"Frank Rizzo" wrote in message
...
I loop through the cells in a range and sometimes, the cell will be part
of the merged area. How do I find out whether the position of the cell
within the merged area? For instance, if the cell is 2nd from the top
and 5th from the left. How do I find out this information?