Hi Tiptop,
First Case- Value to be entered in Cell A1 if empty, otherwise in cell A2:
Set rng1 = IIf(IsEmpty(ws1.Range("A1")), ws1.Range("A1"), ws1.Range("A2"))
-----------------------------------
Second Case - Value to be entered in Cell A1 if empty, otherwise in first
blank cell in column A:
Set NextCell =ws1.Cells(Rows.Count, "A").End(xlUp)(2)
Set rng1 = IIf(IsEmpty(ws1.Range("A1")), ws1.Range("A1"), NextCell)
---
Regards,
Norman
"tiptop " wrote in message
...
Hello all, I have a quick question. I have a spreadsheet that I need
to have remain open in the background of another spreadsheet. I need
to create a code that will take the info from a1 of the main
spreadsheet and input it in a1 of the background spreadsheet. The
tricky part that I can't figure out, is that if a1 on the background
already has something typed in it, then I need it to put the info in
a2, so on and so forth. The background sheet is going to be updated on
a minute by minute basis.
IE.
SheetA.xls (in the background)
SheetB.xls (main screen)
MacroA takes the info from SheetB Cell A1 and puts it in SheetA Cell A1
only if it's empty. If it has something in it already, then it needs
to put it in SheetA Cell A2.
Any Ideas???
Thanks for all the help!!
---
Message posted from http://www.ExcelForum.com/