HI all,
First my thanks for reading, my knowledge is still growing with VBA, and I have hit a snag I'm hoping someone would be able to help me with:
I found this bit of code that seems to work well enough, I can see what is being done here, such as finding data relating to a date, then copy and pasting the comparable
data to its relevant/corresponding sheet.
I need a similar bit of coding, but I can't seem to see beyond the problem... some kind of, Test If!
I see this could be quite a simple bit of coding for my needs. The first four and final five lines of the code is fine,
but I need to be able to get the code to access one sheet "Template" find the date ("B1" [June-16]) and match that
date against a corresponding row ("B1:B12") in another sheet "Annual", find the matching date ("June-16" [B6]) and paste the
content below that date ("C6:C128").
Are you able to help?
Your time is appreciated,
John
First my thanks for reading, my knowledge is still growing with VBA, and I have hit a snag I'm hoping someone would be able to help me with:
Code:
Sub Moving _Data()
1. For Each cell In Range("B1:B1") ' Where to look for the date
2. If cell.Value = "6/1/2011" Then ' The date
3. Range("A4:N100").Select ' What is the range to copy
4. Selection.Copy ' Copy it
>>Sheets("Jun").Select ' Select the Sheet it applies to
1. Range("A1").Select ' Where to paste the data
2. ActiveSheet.Paste
3. Sheets("Template").Select ' Go back to the templete sheet
4. Range("A1").Select
5. Application.CutCopyMode = False ' Remove the copy mode
End Sub
I found this bit of code that seems to work well enough, I can see what is being done here, such as finding data relating to a date, then copy and pasting the comparable
data to its relevant/corresponding sheet.
I need a similar bit of coding, but I can't seem to see beyond the problem... some kind of, Test If!
I see this could be quite a simple bit of coding for my needs. The first four and final five lines of the code is fine,
but I need to be able to get the code to access one sheet "Template" find the date ("B1" [June-16]) and match that
date against a corresponding row ("B1:B12") in another sheet "Annual", find the matching date ("June-16" [B6]) and paste the
content below that date ("C6:C128").
Are you able to help?
Your time is appreciated,
John