Thread
:
Get the cell to the right of a merged cell in VBA
View Single Post
#
4
Posted to microsoft.public.excel.programming
Marcel[_5_]
external usenet poster
Posts: 11
Get the cell to the right of a merged cell in VBA
Thanks,
But when I use "Delete" on the Merged Cell A1 (=A1+B1) I get an exception on
Range("A1").MergeArea.
But Range("A1").Offset(0, 1) works (without .MergeArea)
Marcel
"Nigel" wrote in message
...
Something like this will return the address of the next cell to the right
of a merged group of cells...
Range("A1").MergeArea.Offset(0, 1).Address
--
Regards,
Nigel
"Marcel" wrote in message
...
Hello,
In VBA I would like to find the cell to the right of a merged cell. (or
its column-number)
The column of the cell to the right is not just the column of the
ActiveCell + 1, but it depends on who many columns are merged!
Example:
In row 1 Cell A and B are merged. (A1 and B1 are merged)
The user can select this merged cell. Its name is A1. (B1 is not
existing, as it is merged to A1).
In VBA find now the Column of the cell to the right. In the sheet it is
C1. (so VBA should give column=3 for C).
What is the code for this?
ActiveCell.Next gives 2, means "B", this is wrong, this cell is not
existing.
Thanks for any help
Marcel
Reply With Quote
Marcel[_5_]
View Public Profile
Find all posts by Marcel[_5_]