Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Automatically Delete Text at the end of an imported report into Ex

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SITCFanTN - 26 May 2006 02:34 GMT
I have a report that I import into Excel each day.  At the bottom of the
report is text I want to delete before running a macro.  The number of rows
in the report varies each day.  I'd like to add code in my macro that
automatically deletes that specific text at the end of the report or deletes
the last 3 rows no matter how many rows are in the report.  Can this be done
with VBA code?  Thank you
Tom Ogilvy - 26 May 2006 04:26 GMT
Assume the text is in column A (adjust to the actual situation)

Dim rng as Range
set rng = Cells(rows.count,"A").End(xlup).Offset(-2,0).Resize(3)
rng.entireRow.Delete

Signature

Regards,
Tom Ogilvy

> I have a report that I import into Excel each day.  At the bottom of the
> report is text I want to delete before running a macro.  The number of rows
> in the report varies each day.  I'd like to add code in my macro that
> automatically deletes that specific text at the end of the report or deletes
> the last 3 rows no matter how many rows are in the report.  Can this be done
> with VBA code?  Thank you
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.