............ Foro Excel
Si no lo has hecho aún: REGISTRATE!!!

Calendario userform

Ver el tema anterior Ver el tema siguiente Ir abajo

Calendario userform

Mensaje por josesico el Sáb Jul 12, 2014 9:01 am

Actualmente estoy utilizando en el pc de casa Excel 2013 64 bits en Windows 8.1 64bits y tengo el problema de que algunos controles ocx no funcionan, concretamente los controles de calendario, llevo días tratando de encontrar otra opción que sea compatible si puede ser con todos Excel pero quitando los calendarios matriciales (que por cierto no he conseguido después hacer que el dia que señalo lo refleje en la celda que quiero)no encuentro nada... o mejor dicho si que he encontrado el fichero que adjunto, es un userform  que si ejecuta mi Excel 2013 y el 2007 a 32 bits del trabajo, lo que pasa es que no funciona bien y hay que hacerle unos retoques en el código que yo no he podido (mis conocimientos en VBA son reducidos), en principio es un calendario que empiezan las semanas en domingo, habría que cambiarlo a que empiecen en lunes, se puede elegir mes y año y tiene otro control en la derecha con flechas que no se para que es (en mis pruebas siempre lo quito), pero tiene el fallo que si cambias de mes al seleccionar alguna celda de los días vuelve al mes de enero, dejo el archivo a ver si alguien que sepa de VBA le quiere echar un vistazo y si puede arreglar algo pues estaría bien

No puedo subir el link porque llevo poco tiempo en el foro, lo hare cuando pueda, mientras si alguien me da alguna solución alternativa para poner un calendario en el cual se pueda elegir mes y año y que la fecha que marco se copie a otra celda establecida le estaría agradecido, hasta ahora utilizaba el control de calendario pero como dije antes ahora en casa no puedo porque tengo office 2013 64 bits y Windows 8.1 64bits

El userform lleva 1barra de direccion para elegir mes, despues cuadro de texto donde sale conjunto mes y año y barra de direccion para elegir año que se representa en el mismo cuadro de texto que el mes, despues lleva 42 botones que representan a los dias empezando en domingo, dejo el código aqui:

Private Sub SpinButton1_SpinDown()
'BTG - Changed to Reset curDay based off the last selected day in the form
'curDay = DateAdd("m", -1, CDate(Me.lblMonth))
curDay = DateAdd("m", -1, CDate(curDay))
'-BTG--Removed Code as this is now in PopulateAllDates Sub
'Me.lblMonth.Caption = Format(curDay, "mmmm") & " " & Format(curDay, "yyyy")
PopulateAllDates
End Sub
Private Sub SpinButton1_SpinUp()
'BTG - Changed to Reset curDay based off the last selected day in the form
'curDay = DateAdd("m", 1, CDate(Me.lblMonth))
curDay = DateAdd("m", 1, CDate(curDay))
'-BTG--Removed Code as this is now in PopulateAllDates Sub
'Me.lblMonth.Caption = Format(curDay, "mmmm") & " " & Format(curDay, "yyyy")
PopulateAllDates
End Sub
Private Sub SpinButton2_SpinDown()
'BTG - Changed to Reset curDay based off the last selected day in the form
'curDay = DateAdd("yyyy", -1, CDate(Me.lblMonth))
curDay = DateAdd("yyyy", -1, CDate(curDay))
'-BTG--Removed Code as this is now in PopulateAllDates Sub
'Me.lblMonth.Caption = Format(curDay, "mmmm") & " " & Format(curDay, "yyyy")
PopulateAllDates
End Sub
Private Sub SpinButton2_Spinup()
'BTG - Changed to Reset curDay based off the last selected day in the form
'curDay = DateAdd("yyyy", 1, CDate(Me.lblMonth))
curDay = DateAdd("yyyy", 1, CDate(curDay))
'-BTG--Removed Code as this is now in PopulateAllDates Sub
'Me.lblMonth.Caption = Format(curDay, "mmmm") & " " & Format(curDay, "yyyy")
PopulateAllDates
End Sub
Private Sub sun1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sun2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sun3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sun4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sun5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sun6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub mon1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub mon2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub mon3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub mon4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub mon5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub mon6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub

Private Sub tue1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub tue2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub tue3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub tue4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub tue5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub tue6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub wed1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub wed2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub wed3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub wed4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub wed5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub wed6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub thu1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub thu2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub thu3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub thu4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub thu5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub thu6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub fri1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub fri2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub fri3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub fri4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub fri5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub fri6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sat1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sat2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sat3_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sat4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sat5_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
Private Sub sat6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
SSIDateSelected
End Sub
'-BTG--Created all Click Actions for the Date Buttons to Show User Interaction and changes to the user as they work with the form.
Private Sub sun1_Click()
curDay = sun1.ControlTipText
PopulateAllDates
End Sub
Private Sub sun2_Click()
curDay = sun2.ControlTipText
PopulateAllDates
End Sub
Private Sub sun3_Click()
curDay = sun3.ControlTipText
PopulateAllDates
End Sub
Private Sub sun4_Click()
curDay = sun4.ControlTipText
PopulateAllDates
End Sub
Private Sub sun5_Click()
curDay = sun5.ControlTipText
PopulateAllDates
End Sub
Private Sub sun6_Click()
curDay = sun6.ControlTipText
PopulateAllDates
End Sub
Private Sub mon1_Click()
curDay = mon1.ControlTipText
PopulateAllDates
End Sub
Private Sub mon2_Click()
curDay = mon2.ControlTipText
PopulateAllDates
End Sub
Private Sub mon3_Click()
curDay = mon3.ControlTipText
PopulateAllDates
End Sub
Private Sub mon4_Click()
curDay = mon4.ControlTipText
PopulateAllDates
End Sub
Private Sub mon5_Click()
curDay = mon5.ControlTipText
PopulateAllDates
End Sub
Private Sub mon6_Click()
curDay = mon6.ControlTipText
PopulateAllDates
End Sub
Private Sub tue1_Click()
curDay = tue1.ControlTipText
PopulateAllDates
End Sub
Private Sub tue2_Click()
curDay = tue2.ControlTipText
PopulateAllDates
End Sub
Private Sub tue3_Click()
curDay = tue3.ControlTipText
PopulateAllDates
End Sub
Private Sub tue4_Click()
curDay = tue4.ControlTipText
PopulateAllDates
End Sub
Private Sub tue5_Click()
curDay = tue5.ControlTipText
PopulateAllDates
End Sub
Private Sub tue6_Click()
curDay = tue6.ControlTipText
PopulateAllDates
End Sub
Private Sub wed1_Click()
curDay = wed1.ControlTipText
PopulateAllDates
End Sub
Private Sub wed2_Click()
curDay = wed2.ControlTipText
PopulateAllDates
End Sub
Private Sub wed3_Click()
curDay = wed3.ControlTipText
PopulateAllDates
End Sub
Private Sub wed4_Click()
curDay = wed4.ControlTipText
PopulateAllDates
End Sub
Private Sub wed5_Click()
curDay = wed5.ControlTipText
PopulateAllDates
End Sub
Private Sub wed6_Click()
curDay = wed6.ControlTipText
PopulateAllDates
End Sub
Private Sub thu1_Click()
curDay = thu1.ControlTipText
PopulateAllDates
End Sub
Private Sub thu2_Click()
curDay = thu2.ControlTipText
PopulateAllDates
End Sub
Private Sub thu3_Click()
curDay = thu3.ControlTipText
PopulateAllDates
End Sub
Private Sub thu4_Click()
curDay = thu4.ControlTipText
PopulateAllDates
End Sub
Private Sub thu5_Click()
curDay = thu5.ControlTipText
PopulateAllDates
End Sub
Private Sub thu6_Click()
curDay = thu6.ControlTipText
PopulateAllDates
End Sub
Private Sub fri1_Click()
curDay = fri1.ControlTipText
PopulateAllDates
End Sub
Private Sub fri2_Click()
curDay = fri2.ControlTipText
PopulateAllDates
End Sub
Private Sub fri3_Click()
curDay = fri3.ControlTipText
PopulateAllDates
End Sub
Private Sub fri4_Click()
curDay = fri4.ControlTipText
PopulateAllDates
End Sub
Private Sub fri5_Click()
curDay = fri5.ControlTipText
PopulateAllDates
End Sub
Private Sub fri6_Click()
curDay = fri6.ControlTipText
PopulateAllDates
End Sub
Private Sub sat1_Click()
curDay = sat1.ControlTipText
PopulateAllDates
End Sub
Private Sub sat2_Click()
curDay = sat2.ControlTipText
PopulateAllDates
End Sub
Private Sub sat3_Click()
curDay = sat3.ControlTipText
PopulateAllDates
End Sub
Private Sub sat4_Click()
curDay = sat4.ControlTipText
PopulateAllDates
End Sub
Private Sub sat5_Click()
curDay = sat5.ControlTipText
PopulateAllDates
End Sub
Private Sub sat6_Click()
curDay = sat6.ControlTipText
PopulateAllDates
End Sub

A ver si alguien puede arreglarlo y cambiar el inicio de semana a lunes

josesico

Masculino Cantidad de envíos : 1
Edad : 50
Ciudad - Pais : Zaragoza - España
Version de Excel : Excel 2013 64 bits
Fecha de inscripción : 09/07/2014

Volver arriba Ir abajo

Ver el tema anterior Ver el tema siguiente Volver arriba


 
Permisos de este foro:
No puedes responder a temas en este foro.