Macro/Vba help.
Solved/Closed
PM
-
Oct 14, 2010 at 05:26 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 19, 2010 at 09:49 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Oct 19, 2010 at 09:49 AM
Related:
- Macro/Vba help.
- Vba case like - Guide
- Number to words in excel formula without vba - Guide
- Vba check if value is in array - Guide
- Vba color index - Guide
- How to open vba in excel - Guide
2 responses
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 18, 2010 at 09:32 AM
Oct 18, 2010 at 09:32 AM
Hi PM,
This is what I have come up with:
The fifth line of the code:
I have no idea how cell A10 fits into the story, maybe a typo (A10 = A14).
Best regards,
Trowa
This is what I have come up with:
Sub test() Sheets("sheet3").Select Set c = Range("A1:A365") For Each cell In c If cell.Value = Range("B1").Value Then Sheets("sheet1").Range("A14").Copy cell.Offset(0, 2).PasteSpecial End If Next Application.CutCopyMode = False End Sub
The fifth line of the code:
If cell.Value = Range("B1").Value Thenrefers to the cell B1 of sheet3. Change this cell to whatever you prefer as long as it has the folowing formula in it: =TODAY().
I have no idea how cell A10 fits into the story, maybe a typo (A10 = A14).
Best regards,
Trowa
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Oct 19, 2010 at 09:49 AM
Oct 19, 2010 at 09:49 AM
Hi PM,
Sheet1 is saved in the file called Source.
Sheet3 is saved in the file called Date.
Make sure both workbooks are opened.
Then use this code:
Thanks for the feedback.
Best regards,
Trowa
Sheet1 is saved in the file called Source.
Sheet3 is saved in the file called Date.
Make sure both workbooks are opened.
Then use this code:
Sub test() Workbooks("Date.xls").Sheets("sheet3").Activate Set c = Range("A1:A365") For Each cell In c If cell.Value = Range("B1").Value Then Workbooks("Source.xls").Sheets("sheet1").Range("A14").Copy cell.Offset(0, 2).PasteSpecial End If Next Application.CutCopyMode = False End Sub
Thanks for the feedback.
Best regards,
Trowa
Oct 19, 2010 at 05:31 AM
PM
Oct 19, 2010 at 05:54 AM
Just another quick question.
How would i amend your coding to use different worksheets in other workbooks.
E.g Sheet3 was located in another file called Date.
Thanks