Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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
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
maybe it's simple with macro for this one? driller Excel Worksheet Functions 6 July 16th 07 05:12 PM
Need Simple Macro jreinert New Users to Excel 2 June 15th 06 03:58 PM
Need Help With A Very Simple Macro Amca Excel Discussion (Misc queries) 3 May 7th 05 12:10 AM
Simple Macro - I Think? vinclanz[_2_] Excel Programming 1 September 27th 04 01:21 AM
Simple macro - help please!! Micheal Excel Programming 2 October 24th 03 04:30 PM


All times are GMT +1. The time now is 12:57 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"