MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Forward a cell's contents


Posted by Chris on March 27, 2000 3:41 PM

Is it possible to "forward" information from one cell to another? I've got a cell, (let's say A1) and I cannot put a formula in it (because sometimes data is entered into it manually which would then blow the formula away), but on times when data is not entered into it manually, I would like that cell to reflect the contents of another cell, (let's say from B2), rather than be blank. Is this possible?
Thanks


Posted by Celia on March 27, 2000 11:20 PM

Chris
One way is to put the following macro in the Sheet module.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("A1").Value = "" Then
Range("A1").Formula = "=B2"
End If
End If
End Sub

Celia


Posted by AB on March 28, 2000 6:21 AM

Chris,

Think about the structure of what you're creating.
Why not spread it across 2 cells?

The formula in a second cell might look like this:
=IF(ISBLANK(A1),B2,A1)


Posted by Ivan Moala on March 30, 2000 1:31 AM


Chris
I think Celias macro should read;

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Excel.Range)
If Range("A1").Value = "" Then
Range("A1").Formula = "=B2"
End If

End Sub

There was an extra End If


Ivan