VBA Copy and paste date and add a comment

Fiveshorter

New Member
Joined
Jul 14, 2017
Messages
18
Hi,

I have a vba macro that compares uid in two sheets, once the uid match then i compare the QTY, if the QTY do not match the vba returns incomplete and if they do then it is complete. In my file i have a sheet with the list of uid to be run and also in the next column i have specific dates.

For Each Cell In Rng
If Application.CountIf(sws.Columns(3), Cell.Value) > 0 Then
r = Application.Match(Cell.Value, sws.Columns(3), 0)
If Cell.Offset(0, 18) = sws.Cells(r, 5) Then
Cell.Offset(0, 3) = "Complete 01 August"

Else
Cell.Offset(0, 3) = "Incomplete 01 August"
End If
This is my macro, in the part where i have the comment (Complete 01 august) i would like to let it equal to the date in my sheet. Example below:

sheet1
UID QTY Date
12 2 22/08/17
13 3 23/08/17

Sheet2
UID QTY STATUS
12 2 22/08/17 Complete
13 4 23/08/17 Incomplete

Any help on this would be greatly appreciated!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,215,029
Messages
6,122,760
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top