Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Select Range Name Q

Beginners Q

The code below I am using to try and clear the contents of 12 range
names, but it doesn't clear any info, the range names are correct, not
sure what is wrong

Sub ClearCells()

Application.ScreenUpdating = False
Application.Goto Reference:=Array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Selection.ClearContents
Application.ScreenUpdating = True
Range("A1").Select

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select Range Name Q

Hi Sean,

Try:

'=============
Public Sub ClearCells()
Range("Jan", "Feb", "Mar", "Apr", "May", _
"Jun", "Jul", "Aug", "Sep", "Oct", _
"Nov", "Dec").ClearContents
End Sub
'<<=============


---
Regards,
Norman


"Sean" wrote in message
oups.com...
Beginners Q

The code below I am using to try and clear the contents of 12 range
names, but it doesn't clear any info, the range names are correct, not
sure what is wrong

Sub ClearCells()

Application.ScreenUpdating = False
Application.Goto Reference:=Array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Selection.ClearContents
Application.ScreenUpdating = True
Range("A1").Select



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Select Range Name Q

On Apr 24, 11:55 am, "Norman Jones"
wrote:
Hi Sean,

Try:

'=============
Public Sub ClearCells()
Range("Jan", "Feb", "Mar", "Apr", "May", _
"Jun", "Jul", "Aug", "Sep", "Oct", _
"Nov", "Dec").ClearContents
End Sub
'<<=============

---
Regards,
Norman

"Sean" wrote in message

oups.com...



Beginners Q


The code below I am using to try and clear the contents of 12 range
names, but it doesn't clear any info, the range names are correct, not
sure what is wrong


Sub ClearCells()


Application.ScreenUpdating = False
Application.Goto Reference:=Array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Selection.ClearContents
Application.ScreenUpdating = True
Range("A1").Select- Hide quoted text -


- Show quoted text -


Thanks Norman, I tried that but it debugs at 'Range' with error "Wrong
number of arguements or invalid property assignment"

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select Range Name Q

Hi Sean,

Thanks Norman, I tried that but it debugs at 'Range' with error "Wrong
number of arguements or invalid property assignment"



I could reproduce your error if one of the named ranges
did not exist.


---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Select Range Name Q

Hi Sean,

My Fault!

Try, instead:

'=============
Public Sub ClearCells()
Range("Jan, Feb, Mar, Apr, May, Jun," _
& "Jul, Aug, Sep, Oct, Nov, Dec").ClearContents
End Sub
'<<=============


---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Select Range Name Q

On Apr 24, 12:08 pm, "Norman Jones"
wrote:
Hi Sean,

Thanks Norman, I tried that but it debugs at 'Range' with error "Wrong
number of arguements or invalid property assignment"


I could reproduce your error if one of the named ranges
did not exist.

---
Regards,
Norman


Thanks Norman, and Bob, got it fixed

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Select Range Name Q

On Apr 24, 12:08 pm, "Norman Jones"
wrote:
Hi Sean,

Thanks Norman, I tried that but it debugs at 'Range' with error "Wrong
number of arguements or invalid property assignment"


I could reproduce your error if one of the named ranges
did not exist.

---
Regards,
Norman


Thanks Norman and Bob, fixed the range name

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Select Range Name Q

Application.ScreenUpdating = False
Range("Jan", "Feb", "Mar", "Apr", "May", "Jun", _
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec").ClearContents
Application.ScreenUpdating = True
Range("A1").Select



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Sean" wrote in message
oups.com...
Beginners Q

The code below I am using to try and clear the contents of 12 range
names, but it doesn't clear any info, the range names are correct, not
sure what is wrong

Sub ClearCells()

Application.ScreenUpdating = False
Application.Goto Reference:=Array("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
Selection.ClearContents
Application.ScreenUpdating = True
Range("A1").Select



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
How can change range to select active rows instead of :=Range("S10 ldiaz Excel Discussion (Misc queries) 7 August 29th 08 03:52 PM
When entering data into a range of cells, select the entire range. Q Excel Discussion (Misc queries) 0 September 26th 07 04:36 AM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Compare a selected Range with a Named range and select cells that do not exist PCLIVE Excel Programming 1 October 18th 05 07:09 PM
Select Sheet then Select Range Gee[_2_] Excel Programming 3 May 27th 04 10:10 PM


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