Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple macro help
Hello,
I have a simple macro problem, which is driving me crazy. I built a marco to open a daily text file in excel. Once the report is open I do a Find text, once it finds the text I want it to delete 7 rows up and then 2 rows down. The only problem I have is that I do not want the formula to use cell reference like the one below has. Reason is that the rows I want deleted change for one day to the other. Below is a example from my macro. Cells.FindNext(After:=ActiveCell).Activate Rows("164:170").Select Range("A170").Activate Selection.Delete Shift:=xlUp Rows("164:165").Select Selection.Delete Shift:=xlUp Columns("A:A").Select Thank you very much, any help will be great. Lars |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple macro help
Something like
Set foundCell = Cells.FindNext(After:=ActiveCell) If Not foundCell Is Nothing Then foundCell.Offset(-7,0).Resize(9,1).Entirerow.Delete End If -- HTH RP (remove nothere from the email address if mailing direct) "lars" wrote in message oups.com... Hello, I have a simple macro problem, which is driving me crazy. I built a marco to open a daily text file in excel. Once the report is open I do a Find text, once it finds the text I want it to delete 7 rows up and then 2 rows down. The only problem I have is that I do not want the formula to use cell reference like the one below has. Reason is that the rows I want deleted change for one day to the other. Below is a example from my macro. Cells.FindNext(After:=ActiveCell).Activate Rows("164:170").Select Range("A170").Activate Selection.Delete Shift:=xlUp Rows("164:165").Select Selection.Delete Shift:=xlUp Columns("A:A").Select Thank you very much, any help will be great. Lars |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
maybe it's simple with macro for this one? | Excel Worksheet Functions | |||
Need Simple Macro | New Users to Excel | |||
Need Help With A Very Simple Macro | Excel Discussion (Misc queries) | |||
Simple Macro - I Think? | Excel Programming | |||
Simple macro - help please!! | Excel Programming |