#1   Report Post  
Posted to microsoft.public.excel.misc
Btobin0
 
Posts: n/a
Default Pasting issue

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
C01d
 
Posts: n/a
Default Pasting issue


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.


--
C01d
------------------------------------------------------------------------
C01d's Profile: http://www.excelforum.com/member.php...o&userid=34422
View this thread: http://www.excelforum.com/showthread...hreadid=546318

  #3   Report Post  
Posted to microsoft.public.excel.misc
Btobin0
 
Posts: n/a
Default Pasting issue

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?

"C01d" wrote:


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.


--
C01d
------------------------------------------------------------------------
C01d's Profile: http://www.excelforum.com/member.php...o&userid=34422
View this thread: http://www.excelforum.com/showthread...hreadid=546318


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory or power issue Steven Excel Discussion (Misc queries) 1 May 10th 06 05:06 AM
Wrap Text issue jsAlpha Excel Discussion (Misc queries) 2 January 5th 06 01:56 PM
Force values-only when pasting text to keep formatting BethP Excel Discussion (Misc queries) 2 November 17th 05 07:57 PM
Pasting numbers and formulas without pasting format. Dan Excel Discussion (Misc queries) 3 March 27th 05 03:47 AM
How to remove an extra line added by excel when pasting into notep CoolGuy Excel Discussion (Misc queries) 1 March 2nd 05 02:57 PM


All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"