Pasting issue

G

Guest

I have a macro below where the search takes the information from Cell A1 adds
it to a hyperlink, copies information and pastes it back into excel.
Currently I have the range set to Z3 and Z15 where it pastes. My question is
if the Cell is A1 and has a date in it, how can I have it find another cell
with the same information and paste underneath it?


Range("A2").Select
Selection.Copy
Application.CutCopyMode = False
Application.DisplayAlerts = False
Workbooks.Open Filename:= _
"/total." & Sheet1.Range("a1") & "." & Sheet1.Range("A1") & ".htm"
Range("B6").Select
Selection.UnMerge
Range("B6:B16").Select
Selection.Copy
ActiveWorkbook.Close
Application.DisplayAlerts = False
Sheets("Sheet1").Select
Range("z3").Select
ActiveSheet.Paste
Workbooks.Open Filename:= _
"/total." & Sheet1.Range("a1") & "." & Sheet1.Range("A1") & ".htm"
Range("B18").Select
Selection.UnMerge
Range("B18:B28").Select
Selection.Copy
ActiveWorkbook.Close
Sheets("sheet1").Select
Range("z15").Select
ActiveSheet.Paste
 
C

C01d

You can use the Range.Offset function to move to the next cell.

For instance,
Set r = Range("A1")
Set r = r.offset(0,1)

Use a VBA for loop to control your search
 
G

Guest

a3 a4 a5 a6
4/23 4/24 4/25 4/26

If I say A1 is 4/25 how can I get it to past under 4/25 without telling it
to go there?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top