Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Cell Select Excel 2000 & 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jfcby - 14 Dec 2006 03:23 GMT
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
NickHK - 14 Dec 2006 04:13 GMT
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

> Hello,
>
[quoted text clipped - 40 lines]
> Thank you for your help in advance,
> jfcby
jfcby - 14 Dec 2006 04:41 GMT
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

> Is this what you mean ?
> No need for all those shapes then.
[quoted text clipped - 56 lines]
> > Thank you for your help in advance,
> > jfcby
NickHK - 14 Dec 2006 04:54 GMT
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

> Hello NickHK,
>
[quoted text clipped - 66 lines]
> > > Thank you for your help in advance,
> > > jfcby
jfcby - 14 Dec 2006 12:41 GMT
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

> The B2 selection must be happening in some other code. If you don't want
> that to happen, delete that code.
[quoted text clipped - 73 lines]
> > > > Thank you for your help in advance,
> > > > jfcby
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.