Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enter date in userform using Calendar Control | Excel Discussion (Misc queries) | |||
ENTER A DATE USING CALENDAR CONTROL | Excel Discussion (Misc queries) | |||
Changing values in cell based on system date | Excel Worksheet Functions | |||
How to insert date using a pop up calendar control in a cell i | Excel Discussion (Misc queries) | |||
calendar/date control | Excel Programming |