Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Is there any way we can clear everything..

Hi all,

I am writing a code that can clear everything starting from a named
cell to the end of the sheet. The situation like this..

----------
| START_1 | <---Named cell
----------
Table 1 goes here

----------
| START_2 | <---Named cell
----------
Table 2 goes here .. and so on.

I wish to clear everything from START_1 to the end of the sheet. I
need to clear even the named cells. I tried a recorded macro to clear
all. But that doesn't clear the named cells. Any ideas or
suggestions...Thanks in advance for your advice..

Shishi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Is there any way we can clear everything..

Hi,
This worked for me (Xl2003) to clear columns A to C where
Range("Start") is first named cell in Column A :

Range(Range("Start"), Cells(Cells(Rows.Count, "C").End(xlUp).Row, "C")).Clear


"shishi" wrote:

Hi all,

I am writing a code that can clear everything starting from a named
cell to the end of the sheet. The situation like this..

----------
| START_1 | <---Named cell
----------
Table 1 goes here

----------
| START_2 | <---Named cell
----------
Table 2 goes here .. and so on.

I wish to clear everything from START_1 to the end of the sheet. I
need to clear even the named cells. I tried a recorded macro to clear
all. But that doesn't clear the named cells. Any ideas or
suggestions...Thanks in advance for your advice..

Shishi


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Is there any way we can clear everything..

Dim rng as Range
set rng = Range(range("Start_1").Row & ":65536")EntireRow.Delete
On Error Resume Next
for each nm in ActiveWorkbook.Names
if Instr(1,nm.Refersto,"#Ref",vbTextCompare) then
nm.Delete
end if
Next
On Error goto 0

--
Regards,
Tom Ogilvy

"shishi" wrote in message
oups.com...
Hi all,

I am writing a code that can clear everything starting from a named
cell to the end of the sheet. The situation like this..

----------
| START_1 | <---Named cell
----------
Table 1 goes here

----------
| START_2 | <---Named cell
----------
Table 2 goes here .. and so on.

I wish to clear everything from START_1 to the end of the sheet. I
need to clear even the named cells. I tried a recorded macro to clear
all. But that doesn't clear the named cells. Any ideas or
suggestions...Thanks in advance for your advice..

Shishi



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Is there any way we can clear everything..

Thank you Tom. It really worked.

shishi

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
Transfer a name from one cell to another but leave clear if clear? Scoober Excel Worksheet Functions 3 May 22nd 09 02:55 AM
Why Doesn't it Clear?? Roger Excel Discussion (Misc queries) 5 January 30th 08 10:07 PM
clear the clear the web page email attachment lines MCrider Excel Discussion (Misc queries) 0 November 11th 07 10:05 PM
Not clear dkuz Excel Discussion (Misc queries) 4 February 14th 06 05:45 PM
Clear all? sdmccabe Excel Discussion (Misc queries) 3 December 16th 05 07:51 PM


All times are GMT +1. The time now is 01:16 AM.

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"