#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Calendar

Hi,
I have a cell that when you enter, it brings up a calendar, which works fine
apart from when I want to delete that particular cell and others at the same
time using a macro, the calendar comes up when I dont need it. Is there
something I can enter into the code that would temporarily disable the
calendar so that the cell can be deleted?
Many thanks
John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Calendar

It should not display the Calendar object when the row is deleted unless you
Select the range or row before doing the delete. For example, to NOT do

Range("3:3").Select
Selection.Delete

Instead, reference the range directly without Select:

Range("3:3").Delete

Note, also, that deleting the row does not delete the calendar object. You
might want to post the code you are using and indentify the line(s) that
have the problem.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"JohnUK" wrote in message
...
Hi,
I have a cell that when you enter, it brings up a calendar, which works
fine
apart from when I want to delete that particular cell and others at the
same
time using a macro, the calendar comes up when I dont need it. Is there
something I can enter into the code that would temporarily disable the
calendar so that the cell can be deleted?
Many thanks
John


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Calendar

Hi Chip,
Thank you for your help.
The calendar is activated on H6 and used the following code to delete cells,
but the Calendar keeps coming up:

Range("H6,J6,L6,N6,P6:R6,T6,V6").Select
Selection.ClearContents

I have also tried
Range("H6,J6,L6,N6,P6:R6,T6,V6").Delete

And still it comes up.
Any other ideas?
Regards
John


"Chip Pearson" wrote:

It should not display the Calendar object when the row is deleted unless you
Select the range or row before doing the delete. For example, to NOT do

Range("3:3").Select
Selection.Delete

Instead, reference the range directly without Select:

Range("3:3").Delete

Note, also, that deleting the row does not delete the calendar object. You
might want to post the code you are using and indentify the line(s) that
have the problem.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"JohnUK" wrote in message
...
Hi,
I have a cell that when you enter, it brings up a calendar, which works
fine
apart from when I want to delete that particular cell and others at the
same
time using a macro, the calendar comes up when I dont need it. Is there
something I can enter into the code that would temporarily disable the
calendar so that the cell can be deleted?
Many thanks
John


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Calendar

I'm guessing that the code that brings up the calendar is a worksheet_selection
change event.

And you're selecting a range and that fires the event.

You could use:

application.enableevents = false
Range("H6,J6,L6,N6,P6:R6,T6,V6").Select
application.enableevents = true
Selection.ClearContents

or just

Range("H6,J6,L6,N6,P6:R6,T6,V6").clearcontents

to avoid selecting anything in the first place.

If you have other code that fires (like a worksheet_change event), you may want
to stop that from firing, too.

application.enableevents = false
Range("H6,J6,L6,N6,P6:R6,T6,V6").clearcontents
application.enableevents = true



JohnUK wrote:

Hi Chip,
Thank you for your help.
The calendar is activated on H6 and used the following code to delete cells,
but the Calendar keeps coming up:

Range("H6,J6,L6,N6,P6:R6,T6,V6").Select
Selection.ClearContents

I have also tried
Range("H6,J6,L6,N6,P6:R6,T6,V6").Delete

And still it comes up.
Any other ideas?
Regards
John

"Chip Pearson" wrote:

It should not display the Calendar object when the row is deleted unless you
Select the range or row before doing the delete. For example, to NOT do

Range("3:3").Select
Selection.Delete

Instead, reference the range directly without Select:

Range("3:3").Delete

Note, also, that deleting the row does not delete the calendar object. You
might want to post the code you are using and indentify the line(s) that
have the problem.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"JohnUK" wrote in message
...
Hi,
I have a cell that when you enter, it brings up a calendar, which works
fine
apart from when I want to delete that particular cell and others at the
same
time using a macro, the calendar comes up when I dont need it. Is there
something I can enter into the code that would temporarily disable the
calendar so that the cell can be deleted?
Many thanks
John



--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 173
Default Calendar

Many thanks Dave, they both worked.
Much appreciate the help from both you and Chip
Best Regards
John

"Dave Peterson" wrote:

I'm guessing that the code that brings up the calendar is a worksheet_selection
change event.

And you're selecting a range and that fires the event.

You could use:

application.enableevents = false
Range("H6,J6,L6,N6,P6:R6,T6,V6").Select
application.enableevents = true
Selection.ClearContents

or just

Range("H6,J6,L6,N6,P6:R6,T6,V6").clearcontents

to avoid selecting anything in the first place.

If you have other code that fires (like a worksheet_change event), you may want
to stop that from firing, too.

application.enableevents = false
Range("H6,J6,L6,N6,P6:R6,T6,V6").clearcontents
application.enableevents = true



JohnUK wrote:

Hi Chip,
Thank you for your help.
The calendar is activated on H6 and used the following code to delete cells,
but the Calendar keeps coming up:

Range("H6,J6,L6,N6,P6:R6,T6,V6").Select
Selection.ClearContents

I have also tried
Range("H6,J6,L6,N6,P6:R6,T6,V6").Delete

And still it comes up.
Any other ideas?
Regards
John

"Chip Pearson" wrote:

It should not display the Calendar object when the row is deleted unless you
Select the range or row before doing the delete. For example, to NOT do

Range("3:3").Select
Selection.Delete

Instead, reference the range directly without Select:

Range("3:3").Delete

Note, also, that deleting the row does not delete the calendar object. You
might want to post the code you are using and indentify the line(s) that
have the problem.


--
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2008
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


"JohnUK" wrote in message
...
Hi,
I have a cell that when you enter, it brings up a calendar, which works
fine
apart from when I want to delete that particular cell and others at the
same
time using a macro, the calendar comes up when I donĂ¢‚¬„¢t need it. Is there
something I can enter into the code that would temporarily disable the
calendar so that the cell can be deleted?
Many thanks
John



--

Dave Peterson



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
find free sharware to include calendar pop or use calendar in cell ednc Excel Discussion (Misc queries) 2 April 14th 08 05:05 PM
how do i export excel calendar info to outlook calendar? Maggie Excel Discussion (Misc queries) 1 December 31st 07 10:27 PM
monthview calendar question/ want the calendar to display weekdays only.. [email protected] Excel Programming 0 August 26th 07 09:25 PM
excel calendar - list of names displayed on calendar Brian'88 Excel Worksheet Functions 3 November 17th 06 10:31 PM
Modify Yearly Calendar to Monthly Calendar Excel 2000? James Cooper Excel Programming 13 July 13th 06 11:46 PM


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