Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
A second option would be to assign the macro a short cut key (I like control
"q") and add SendKeys ("^q") to the end of the query. It will keep running until you hit pause/break. "Khoshravan" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Thanks for you reply but I am a beginner in MAcro so I almost couldn't
understand what does your Macro do. I copy paste it my Excel work book but it didn't produce my requested results. |
#5
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
You did not say what the problem is. I said, IF your layout is as shown, it
will work. What is your layout? Send me a workbook (to email below) and I will take a look. -- Don Guillett SalesAid Software "Khoshravan" wrote in message oups.com... Thanks for you reply but I am a beginner in MAcro so I almost couldn't understand what does your Macro do. I copy paste it my Excel work book but it didn't produce my requested results. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Editing a simple macro | Excel Worksheet Functions | |||
Can T Get Macro To Run! | New Users to Excel | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |