Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Calendar Control Changing System Date

I have added a calendar control to one of my forms, and now every time
that I select a date and execute the macro behind the form, the system
date changes. Has anyone else experienced this? Is there a
work-around?

I have added the Microsoft Calendar Control 11.0 in the references. m

I just have never experienced it modifying the system date before.

Thanks for any assistance.

Rob

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calendar Control Changing System Date

Hi Rob

Can we see the code ?


--
Regards Ron de Bruin
http://www.rondebruin.nl


"rob_parkhill" wrote in message oups.com...
I have added a calendar control to one of my forms, and now every time
that I select a date and execute the macro behind the form, the system
date changes. Has anyone else experienced this? Is there a
work-around?

I have added the Microsoft Calendar Control 11.0 in the references. m

I just have never experienced it modifying the system date before.

Thanks for any assistance.

Rob



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Calendar Control Changing System Date

Ron,

Here is a snippet. I have included the loop that I do checking the
Date. I have tried modifying the name (Date) to something else, seeing
as I think that is most likely the problem, but when I do that, it
doesn't match the dates in the column at all.

Private Sub Go_Click()
Application.ScreenUpdating = False

file = filename.Value
Date = DTPicker1.Value
samp = samples.Value

If file < "" And Date < "" And samp < "" Then

reportval = CStr(file) & ".dbf"
Location = "C:\Documents and Settings\Classroom 1\Desktop\peas\" &
reportval
Original = ThisWorkbook.Name

firstsheet = ActiveSheet.Name

cspot = "A2"

Worksheets("Datasheet").Activate
Range("A2:BB30").Select
Selection.Clear
Range(cspot).Select
On Error GoTo err_handler
Workbooks.Open filename:=Location


startval = "E" & CStr(2)
Endval = "AF" & CStr(11)



Windows(reportval).Activate
Range("j2").Select
counter = 0
For Each x In ActiveCell.CurrentRegion.Cells
counter = counter + 1
spot = "J" & CStr(counter)

Range(spot).Select
If Selection.Value < "" Then
If Selection.Value = Date Then
pos = counter
Exit For
End If
End If
Next x
If pos = "" Then
MsgBox "No Matching Dates"
End If
If pos < "" Then
select1 = "E" & CStr(pos)
select2 = "AF" & CStr(samp + pos - 1)
Range(select1, select2).Select
End If

Thanks for any help
Rob

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Calendar Control Changing System Date

You see in my other reply that my date is wrong<g


--
Regards Ron de Bruin
http://www.rondebruin.nl


"rob_parkhill" wrote in message oups.com...
Ron,

Here is a snippet. I have included the loop that I do checking the
Date. I have tried modifying the name (Date) to something else, seeing
as I think that is most likely the problem, but when I do that, it
doesn't match the dates in the column at all.

Private Sub Go_Click()
Application.ScreenUpdating = False

file = filename.Value
Date = DTPicker1.Value
samp = samples.Value

If file < "" And Date < "" And samp < "" Then

reportval = CStr(file) & ".dbf"
Location = "C:\Documents and Settings\Classroom 1\Desktop\peas\" &
reportval
Original = ThisWorkbook.Name

firstsheet = ActiveSheet.Name

cspot = "A2"

Worksheets("Datasheet").Activate
Range("A2:BB30").Select
Selection.Clear
Range(cspot).Select
On Error GoTo err_handler
Workbooks.Open filename:=Location


startval = "E" & CStr(2)
Endval = "AF" & CStr(11)



Windows(reportval).Activate
Range("j2").Select
counter = 0
For Each x In ActiveCell.CurrentRegion.Cells
counter = counter + 1
spot = "J" & CStr(counter)

Range(spot).Select
If Selection.Value < "" Then
If Selection.Value = Date Then
pos = counter
Exit For
End If
End If
Next x
If pos = "" Then
MsgBox "No Matching Dates"
End If
If pos < "" Then
select1 = "E" & CStr(pos)
select2 = "AF" & CStr(samp + pos - 1)
Range(select1, select2).Select
End If

Thanks for any help
Rob



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
Enter date in userform using Calendar Control Scotty9349 Excel Discussion (Misc queries) 1 March 4th 09 07:02 PM
ENTER A DATE USING CALENDAR CONTROL Asoka Walpitagama - Brandix College IT Excel Discussion (Misc queries) 2 January 29th 09 11:31 AM
Changing values in cell based on system date [email protected] Excel Worksheet Functions 2 October 24th 08 07:33 AM
How to insert date using a pop up calendar control in a cell i Sunnyskies Excel Discussion (Misc queries) 0 October 16th 06 09:16 AM
calendar/date control peter Excel Programming 1 June 9th 04 04:02 PM


All times are GMT +1. The time now is 11:51 PM.

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"