PC Review


Reply
Thread Tools Rate Thread

Cell Select Excel 2000 & 2003

 
 
jfcby
Guest
Posts: n/a
 
      14th Dec 2006
Hello,

Worksheet3 rowB cells8-15, I need each cell when clicked in to call
Macro PERSONAL.XLS!OpenCalendar (popup calendar) and select the cell
so that when the date is clicked on the calendar it will be inserted in
the click cell.

To get the each cell active I've placed a rectangle to call the
PERSONAL.XLS!OpenCalendar (popup calendar). But, with the code below
when I click in cell 8-14 it always selects cell15.

How can the code be changed so that when I click in cell 8-14 it will
be selected to insert the date from the popup calendar?

Sub CellDateActivate()
With ActiveSheet.Shapes("Rectangle 4").Select
Range("B8").Select
End With
With ActiveSheet.Shapes("Rectangle 5").Select
Range("B9").Select
End With
With ActiveSheet.Shapes("Rectangle 6").Select
Range("B10").Select
End With
With ActiveSheet.Shapes("Rectangle 7").Select
Range("B11").Select
End With
With ActiveSheet.Shapes("Rectangle 8").Select
Range("B12").Select
End With
With ActiveSheet.Shapes("Rectangle 9").Select
Range("B13").Select
End With
With ActiveSheet.Shapes("Rectangle 10").Select
Range("B14").Select
End With
With ActiveSheet.Shapes("Rectangle 11").Select
Range("B15").Select
End With
Application.Run "PERSONAL.XLS!OpenCalendar"
End Sub

Thank you for your help in advance,
jfcby

 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      14th Dec 2006
Is this what you mean ?
No need for all those shapes then.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not Intersect(Target, Range("B8:B15")) Is Nothing Then
Application.EnableEvents = False
Target(1).Select
Application.EnableEvents = True
Application.Run "PERSONAL.XLS!OpenCalendar"
End If

End Sub

NickHK

"jfcby" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> Worksheet3 rowB cells8-15, I need each cell when clicked in to call
> Macro PERSONAL.XLS!OpenCalendar (popup calendar) and select the cell
> so that when the date is clicked on the calendar it will be inserted in
> the click cell.
>
> To get the each cell active I've placed a rectangle to call the
> PERSONAL.XLS!OpenCalendar (popup calendar). But, with the code below
> when I click in cell 8-14 it always selects cell15.
>
> How can the code be changed so that when I click in cell 8-14 it will
> be selected to insert the date from the popup calendar?
>
> Sub CellDateActivate()
> With ActiveSheet.Shapes("Rectangle 4").Select
> Range("B8").Select
> End With
> With ActiveSheet.Shapes("Rectangle 5").Select
> Range("B9").Select
> End With
> With ActiveSheet.Shapes("Rectangle 6").Select
> Range("B10").Select
> End With
> With ActiveSheet.Shapes("Rectangle 7").Select
> Range("B11").Select
> End With
> With ActiveSheet.Shapes("Rectangle 8").Select
> Range("B12").Select
> End With
> With ActiveSheet.Shapes("Rectangle 9").Select
> Range("B13").Select
> End With
> With ActiveSheet.Shapes("Rectangle 10").Select
> Range("B14").Select
> End With
> With ActiveSheet.Shapes("Rectangle 11").Select
> Range("B15").Select
> End With
> Application.Run "PERSONAL.XLS!OpenCalendar"
> End Sub
>
> Thank you for your help in advance,
> jfcby
>



 
Reply With Quote
 
jfcby
Guest
Posts: n/a
 
      14th Dec 2006
Hello NickHK,

Thank you for the modifed code it works but after the date is entered
in B8 it goes to B2 and scrolls through all the cells B8:B15. Is there
a way to add a msgbox with the option to exit sub or enter another date
in next cell?

Thank you for your help,
jfcby

NickHK wrote:
> Is this what you mean ?
> No need for all those shapes then.
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>
> If Not Intersect(Target, Range("B8:B15")) Is Nothing Then
> Application.EnableEvents = False
> Target(1).Select
> Application.EnableEvents = True
> Application.Run "PERSONAL.XLS!OpenCalendar"
> End If
>
> End Sub
>
> NickHK
>
> "jfcby" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello,
> >
> > Worksheet3 rowB cells8-15, I need each cell when clicked in to call
> > Macro PERSONAL.XLS!OpenCalendar (popup calendar) and select the cell
> > so that when the date is clicked on the calendar it will be inserted in
> > the click cell.
> >
> > To get the each cell active I've placed a rectangle to call the
> > PERSONAL.XLS!OpenCalendar (popup calendar). But, with the code below
> > when I click in cell 8-14 it always selects cell15.
> >
> > How can the code be changed so that when I click in cell 8-14 it will
> > be selected to insert the date from the popup calendar?
> >
> > Sub CellDateActivate()
> > With ActiveSheet.Shapes("Rectangle 4").Select
> > Range("B8").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 5").Select
> > Range("B9").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 6").Select
> > Range("B10").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 7").Select
> > Range("B11").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 8").Select
> > Range("B12").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 9").Select
> > Range("B13").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 10").Select
> > Range("B14").Select
> > End With
> > With ActiveSheet.Shapes("Rectangle 11").Select
> > Range("B15").Select
> > End With
> > Application.Run "PERSONAL.XLS!OpenCalendar"
> > End Sub
> >
> > Thank you for your help in advance,
> > jfcby
> >


 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      14th Dec 2006
The B2 selection must be happening in some other code. If you don't want
that to happen, delete that code.
You don't to call your "CellDateActivate" routine now, do you ?

NickHK

"jfcby" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello NickHK,
>
> Thank you for the modifed code it works but after the date is entered
> in B8 it goes to B2 and scrolls through all the cells B8:B15. Is there
> a way to add a msgbox with the option to exit sub or enter another date
> in next cell?
>
> Thank you for your help,
> jfcby
>
> NickHK wrote:
> > Is this what you mean ?
> > No need for all those shapes then.
> >
> > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> >
> > If Not Intersect(Target, Range("B8:B15")) Is Nothing Then
> > Application.EnableEvents = False
> > Target(1).Select
> > Application.EnableEvents = True
> > Application.Run "PERSONAL.XLS!OpenCalendar"
> > End If
> >
> > End Sub
> >
> > NickHK
> >
> > "jfcby" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hello,
> > >
> > > Worksheet3 rowB cells8-15, I need each cell when clicked in to call
> > > Macro PERSONAL.XLS!OpenCalendar (popup calendar) and select the cell
> > > so that when the date is clicked on the calendar it will be inserted

in
> > > the click cell.
> > >
> > > To get the each cell active I've placed a rectangle to call the
> > > PERSONAL.XLS!OpenCalendar (popup calendar). But, with the code below
> > > when I click in cell 8-14 it always selects cell15.
> > >
> > > How can the code be changed so that when I click in cell 8-14 it will
> > > be selected to insert the date from the popup calendar?
> > >
> > > Sub CellDateActivate()
> > > With ActiveSheet.Shapes("Rectangle 4").Select
> > > Range("B8").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 5").Select
> > > Range("B9").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 6").Select
> > > Range("B10").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 7").Select
> > > Range("B11").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 8").Select
> > > Range("B12").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 9").Select
> > > Range("B13").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 10").Select
> > > Range("B14").Select
> > > End With
> > > With ActiveSheet.Shapes("Rectangle 11").Select
> > > Range("B15").Select
> > > End With
> > > Application.Run "PERSONAL.XLS!OpenCalendar"
> > > End Sub
> > >
> > > Thank you for your help in advance,
> > > jfcby
> > >

>



 
Reply With Quote
 
jfcby
Guest
Posts: n/a
 
      14th Dec 2006
Hello NickHK,

Thank you for your help! When I deleted the retangles that had the
CellDateActivate macro assigned to it that fixed the problem.

Thank you,
jfcby


NickHK wrote:
> The B2 selection must be happening in some other code. If you don't want
> that to happen, delete that code.
> You don't to call your "CellDateActivate" routine now, do you ?
>
> NickHK
>
> "jfcby" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hello NickHK,
> >
> > Thank you for the modifed code it works but after the date is entered
> > in B8 it goes to B2 and scrolls through all the cells B8:B15. Is there
> > a way to add a msgbox with the option to exit sub or enter another date
> > in next cell?
> >
> > Thank you for your help,
> > jfcby
> >
> > NickHK wrote:
> > > Is this what you mean ?
> > > No need for all those shapes then.
> > >
> > > Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> > >
> > > If Not Intersect(Target, Range("B8:B15")) Is Nothing Then
> > > Application.EnableEvents = False
> > > Target(1).Select
> > > Application.EnableEvents = True
> > > Application.Run "PERSONAL.XLS!OpenCalendar"
> > > End If
> > >
> > > End Sub
> > >
> > > NickHK
> > >
> > > "jfcby" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > Hello,
> > > >
> > > > Worksheet3 rowB cells8-15, I need each cell when clicked in to call
> > > > Macro PERSONAL.XLS!OpenCalendar (popup calendar) and select the cell
> > > > so that when the date is clicked on the calendar it will be inserted

> in
> > > > the click cell.
> > > >
> > > > To get the each cell active I've placed a rectangle to call the
> > > > PERSONAL.XLS!OpenCalendar (popup calendar). But, with the code below
> > > > when I click in cell 8-14 it always selects cell15.
> > > >
> > > > How can the code be changed so that when I click in cell 8-14 it will
> > > > be selected to insert the date from the popup calendar?
> > > >
> > > > Sub CellDateActivate()
> > > > With ActiveSheet.Shapes("Rectangle 4").Select
> > > > Range("B8").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 5").Select
> > > > Range("B9").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 6").Select
> > > > Range("B10").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 7").Select
> > > > Range("B11").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 8").Select
> > > > Range("B12").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 9").Select
> > > > Range("B13").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 10").Select
> > > > Range("B14").Select
> > > > End With
> > > > With ActiveSheet.Shapes("Rectangle 11").Select
> > > > Range("B15").Select
> > > > End With
> > > > Application.Run "PERSONAL.XLS!OpenCalendar"
> > > > End Sub
> > > >
> > > > Thank you for your help in advance,
> > > > jfcby
> > > >

> >


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Select the first cell of the last row in a range - Excel 2003 Gary''s Student Microsoft Excel New Users 0 2nd Apr 2009 12:56 AM
Re: Excel 2003 - VBA - Error on Cell Select Don Guillett Microsoft Excel Discussion 2 7th Jan 2009 04:57 PM
Excel 2003 - VBA - Cell Select Craig Brandt Microsoft Excel Discussion 5 2nd Jun 2008 03:07 AM
In Microsoft Excel 2003, when I select a color for a cell it does. =?Utf-8?B?SnVkZQ==?= Microsoft Excel Worksheet Functions 3 13th Mar 2005 04:55 PM
Excel 2003, Cell Select becomes Column Select PamBuffington Microsoft Excel Misc 2 16th Aug 2004 10:05 PM


Features
 

Advertising
 

Newsgroups
 


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