ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy if adjacent Cell has data (https://www.excelbanter.com/excel-programming/429021-copy-if-adjacent-cell-has-data.html)

Jeff Gross

Copy if adjacent Cell has data
 
I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff

Jacob Skaria

Copy if adjacent Cell has data
 
In Cell A2

=B2

If this post helps click Yes
---------------
Jacob Skaria


"Jeff Gross" wrote:

I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff


Patrick Molloy

Copy if adjacent Cell has data
 
if Range("B2").Value <"" then Range("A2")=Range("B2").Value

"Jeff Gross" wrote in message
...
I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff



Jeff Gross

Copy if adjacent Cell has data
 
Sorry but I didn't make myself clear. I am copying from a different
worksheet into A2 if there is any data in B2.

Jeff.

"Patrick Molloy" wrote:

if Range("B2").Value <"" then Range("A2")=Range("B2").Value

"Jeff Gross" wrote in message
...
I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff




Jacob Skaria

Copy if adjacent Cell has data
 
OR may be

Range("A2").value=Range("b2").value

--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

In Cell A2

=B2

If this post helps click Yes
---------------
Jacob Skaria


"Jeff Gross" wrote:

I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff


Jacob Skaria

Copy if adjacent Cell has data
 
Add extension if the workbook is saved....

Workbooks("book1").Sheets("Sheet1").Range("A2") =
Workbooks("book2").Sheets("Sheet1").Range("B2")

If this post helps click Yes
---------------
Jacob Skaria


"Jeff Gross" wrote:

Sorry but I didn't make myself clear. I am copying from a different
worksheet into A2 if there is any data in B2.

Jeff.

"Patrick Molloy" wrote:

if Range("B2").Value <"" then Range("A2")=Range("B2").Value

"Jeff Gross" wrote in message
...
I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff




Jeff Gross

Copy if adjacent Cell has data
 
I also need this code to cycle through all cells down to row 300.

"Jeff Gross" wrote:

Sorry but I didn't make myself clear. I am copying from a different
worksheet into A2 if there is any data in B2.

Jeff.

"Patrick Molloy" wrote:

if Range("B2").Value <"" then Range("A2")=Range("B2").Value

"Jeff Gross" wrote in message
...
I need to copy text into a cell "A2" if there is any data in "B2". B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff




Don Guillett

Copy if adjacent Cell has data
 
You also need to FULLY state your question the FIRST time.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jeff Gross" wrote in message
...
I also need this code to cycle through all cells down to row 300.

"Jeff Gross" wrote:

Sorry but I didn't make myself clear. I am copying from a different
worksheet into A2 if there is any data in B2.

Jeff.

"Patrick Molloy" wrote:

if Range("B2").Value <"" then Range("A2")=Range("B2").Value

"Jeff Gross" wrote in message
...
I need to copy text into a cell "A2" if there is any data in "B2".
B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff




Patrick Molloy

Copy if adjacent Cell has data
 
the following copies a range from one worksheet to another. it copies empy
cells, but does that make any difference?

worksheets("sheet2").Range("B1:B300").Value =
worksheets("sheet1").Range("B1:B300").Value



"Don Guillett" wrote in message
...
You also need to FULLY state your question the FIRST time.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Jeff Gross" wrote in message
...
I also need this code to cycle through all cells down to row 300.

"Jeff Gross" wrote:

Sorry but I didn't make myself clear. I am copying from a different
worksheet into A2 if there is any data in B2.

Jeff.

"Patrick Molloy" wrote:

if Range("B2").Value <"" then Range("A2")=Range("B2").Value

"Jeff Gross" wrote in message
...
I need to copy text into a cell "A2" if there is any data in "B2".
B2
contains a formula but will appear blank if its source has nothing.

Any ideas?

Jeff





All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com