View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default Access to the value of a merged cell in a formula

Hi Zlika-

I don't believe there is a standard way of dealing with your situation as I
understand it. However, we may be able to exploit your data structure if it
is consistent.

I'm not certain from your description whether you want blanks in your
formula column when A2 is empty. Using your example of merged cells in column
A, you could try one of these two approaches:

Approach 1: In cell b1, enter this formula and copy it downward:
=IF(A1="","",A1)

Approach 2. Step a - In cell b1, enter this formula: =IF(A1="","",A1)
Step b - Then, in cell c1, enter this formula and copy it downward:
=IF(A2="",B1,A2)

---
Jay


"Zlika" wrote:

Hi everybody,
In my worksheet, the A1 cell is merged with the A2 cell (for example). My
problem is that when I want to access to the value of the A2 cell (by typing
"=A2" in another cell), it returns 0 instead of the value of the merged cell
(which is in fact the value of the A1 cell).

I know how to do in VBA (using .MergedArea.Cells(1,1) to access to the value
of the first cell of the merged area) but not directly in an Excel formula
(and I do not know in a general case that A1 and A2 are merged, so I cannot
use "=A1").

Do someone know how to do it?
Thank you very much

Zlika