LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
Khoshravan
 
Posts: n/a
Default how to put a loop in a macro?

I have a macro as follows:
Sub Macro2()
ActiveCell.Offset(-1, 0).Range("A1").Select
Selection.Hyperlinks.Delete
Selection.Cut
ActiveCell.Offset(-1, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Rows("1:2").EntireRow.Select
Selection.Delete Shift:=xlUp
ActiveCell.Offset(2, 0).Range("A1").Select
End Sub

It selects the above cell. Remove the hyperlink, moves it to top-right
cell, selects two rows and delete them and sits in the two rows below
same cell as started and ready to do this task again. I have many lins
to do this task and if I want to repeat the macro for each loop it
takes long long time. I want Macro to do all for me.
I want to put this Macro in a loop to do these tasks as long as there
is a row below and stops when it reaches the last row.
How can I make the loop in this macro?
TIA, Rasoul Khoshravan

 
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
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 09:19 PM
Can T Get Macro To Run! Nipper New Users to Excel 2 November 4th 05 04:48 AM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 01:14 PM.

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

About Us

"It's about Microsoft Excel"