Hello All, thank you for your help
I am looking for a VBA/Macro that will sort through each cell in column "E" (dates) and compare it to each cell in a row 1 "H1:BE1". When a matching date is found I would like the code to insert a shape or value into the respective cell. My code is below, however it is very rough. I cannot seem to have the code move with the for loop.
Any help or guidance would be greatly appreciated.
Cheers!
I am looking for a VBA/Macro that will sort through each cell in column "E" (dates) and compare it to each cell in a row 1 "H1:BE1". When a matching date is found I would like the code to insert a shape or value into the respective cell. My code is below, however it is very rough. I cannot seem to have the code move with the for loop.
Code:
[TABLE="width: 76"]
<colgroup><col></colgroup><tbody>[TR]
[TD]Sub Attempt_6()[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]Dim cel As Range[/TD]
[/TR]
[TR]
[TD]Dim rng As Range[/TD]
[/TR]
[TR]
[TD]Dim ws As Worksheet[/TD]
[/TR]
[TR]
[TD]Sheets("Andrew").Range("U3: W16").ClearContents[/TD]
[/TR]
[TR]
[TD] For Each cel In Range("U1:W1")[/TD]
[/TR]
[TR]
[TD]' For Each rng In Range("A3:A4")[/TD]
[/TR]
[TR]
[TD] If cel.Value = Range("A4") Then[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Range("A1").Copy 'Range("U4:W5")[/TD]
[/TR]
[TR]
[TD] Cells(4, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial xlPasteFormulas[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD] Else[/TD]
[/TR]
[TR]
[TD] Range("A2").Copy[/TD]
[/TR]
[TR]
[TD] Cells(4, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial xlPasteFormulas[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD] End If[/TD]
[/TR]
[TR]
[TD] Next cel[/TD]
[/TR]
[TR]
[TD] [/TD]
[/TR]
[TR]
[TD]End Sub[/TD]
[/TR]
</tbody>[/TABLE]
Any help or guidance would be greatly appreciated.
Cheers!