ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to create a Macro to Copy Information in one sheet to another sheet. (https://www.excelbanter.com/excel-programming/305111-how-create-macro-copy-information-one-sheet-another-sheet.html)

poppy

How to create a Macro to Copy Information in one sheet to another sheet.
 
Hi All

I was wondering how I can create a Macro to copy information that is o
Sheet1 to SHeet2. The kink is that it only should copy the informatio
in Column A when for example column C has a cell in it saying "YES"
Please let me know at your earliest convience.

Thank You

--
Message posted from http://www.ExcelForum.com


DNF Karran[_26_]

How to create a Macro to Copy Information in one sheet to another sheet.
 
Why not use an if statement?

=IF(Sheet2!C1="YES",Sheet2!A1,""

--
Message posted from http://www.ExcelForum.com


MiRa

How to create a Macro to Copy Information in one sheet to another sheet.
 
or to write code on Sheet1

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column = 1 And Cells(Target.Row, 3) = "Yes" Then
Worksheets("Sheet2").Range(Target.Address).Value = Target.Value
Else
End If

End Sub

MiRa



"DNF Karran " píše v diskusním
příspěvku ...
Why not use an if statement?

=IF(Sheet2!C1="YES",Sheet2!A1,"")


---
Message posted from http://www.ExcelForum.com/




poppy

How to create a Macro to Copy Information in one sheet to another sheet.
 
Hi MiRa


I get this error: 424 Object Required and it selects this line


Code
-------------------
If Target.Column = 1 And Cells(Target.Row, 3) = "YES" Then

-------------------


Any idea what is wrong?

Kind Regard

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 03:42 AM.

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