LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default Clear contents macro

Hi
I have a macro that clears the contents of a sheet after I have
imported the data into a database.
This works fine but if the data is less then 175 rows it leaves
blank rows in the database.
How can I get round this.
Not very good with VBA would appreciate any help
Macro as below:-

Range("A2:N175").select
Selection.ClearContents
Range("A2").Select
Workbooks("MyBook1.xls").Close SaveChange:=True



 
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
Macro to clear contents of certain cells MrAcquire Excel Discussion (Misc queries) 3 February 11th 10 05:25 PM
Macro to clear contents and put an X bevchapman Excel Discussion (Misc queries) 3 March 17th 09 07:03 PM
Need macro to clear contents steve_sr2[_2_] Excel Programming 4 February 28th 06 09:20 AM
Clear Contents Macro SJC Excel Worksheet Functions 3 October 27th 05 07:26 PM
MACRO TO CLEAR CELL CONTENTS Jay Dean Excel Programming 2 October 11th 03 02:51 PM


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