Saltar al contenido

How to Make the First Issue of the Past Month Appear as (26) which was on Monday


Recommended Posts

publicado

Hello everyone from Maurizio
My problem is this .
I'm trying but failing to want to create some sort of Calendar
Slo that my problem with the vba is this:
in a userform I inserted a Textbox and Seven Labels, of which 6 are classified as (Cella1,Cella2,Cella3) etc...!
And I want them to stay that way.

While a label the name has remained unchanged and is called (Label3)

Now what I would like to get from vba code, and that every time I start the userform the Labels classified as (Cella1 etc ...! the number "26" is reported which corresponds to the number of the month of December which was (Monday ) and gradually all the other ends to reach (1) of the following week which corresponds to the Number of the beginning of this month.

In addition, if it were possible, I would like to be able to make the start date of the month appear in (Label3) as a code, as I manually reported, to better understand "01/01/2023"

Clearly if I change the date in the Texbox these data must be able to change accordingly.

I don't expect you to do all the work for me It would be enough for me
just to see the Number (26) appear in the label (Cella1) and the start date of the month in (Label3)
Thank you
Greetings from A.Maurizio

Numero_Setimana_Inizio_Mese.xlsm

publicado

Ciao Antony
Ascolta ho pensato che avrei potuto da qui in poi per poter risolvere il mio problema seguendo le tue direttive; Che come sempre sono fantastici.
Ma ho provato a dargli altre direttive, ma non funziona come vorrei.
Quindi ascolta: potresti dare un'occhiata al mio file
excel e provare a fare la stessa cosa solo usando il vba all'interno del modulo .

Mi spiego: sul foglio Excel nella colonna (A1:A5) avevo estratto tutti i dati necessari per formare un calendario molto semplice.
Facendo così:

1) data odierna (=Ora())2) L'anno (=Anno(A1))3) Inserisco l'anno come testo e lo trasformo come inizio del mese (01/01/2023 )

utilizzando questa funzione (=DATA(A2; A4;1))
4) Estraggo la media Dalla data odierna (=DATA(A2; A4;1))
5 ) Infine estraggo il numero del giorno della settimana
Dall'inizio del mese mese che è uguale a "26" ( = MESE(A1))

Il resto delle celle del foglio Excel mostra i vari numeri del mese seguendo questa logica:nella cella (B4) che corrisponde al "26" Giorno del mese precedente ho scritto( =(A3-WEEKDAY(A3,3))Pur partendo dalla Cella (C4) e gradualmente per tutte le altre ho appena scritto
:

(=B4+1)
; (=C4+1) ; (=D4+1) ecc...!

Ora quello che vorrei sapere è se fosse possibile a livello di modulo; Ma senza collegamenti al foglio Excel.
Essere in grado di ripetere la stessa cosa con il vba.

Questo è tutto?
Sto pubblicando il mio lavoro fatto qualche tempo fa a livello di foglio; Quindi puoi dargli un'occhiata più da vicino E se fosse
possibile, non potresti non usare l'etichetta (Dynamics)
Ma solo chiamandoli (Cell1); (Cella2) ecc...!
Grazie. Sei fantastico come sempre.
Saluti da Maurice

 

Calendario Per Enrico.xlsm

publicado

Hello @A.Maurizio,

 

I so not understand very well what you want to do (well, yes, a calendar...) , but no why in this way. You have a calendar (made by @Antoni) in the download section.

Maybe it is what you need

publicado

Hi Haplox Thanks for your support
And this work is beautiful
But it's far from what I want to do, I just lack the initial steps to get all that basic information.
That's all
Thanks again for everything both you and Antoni
I'll try to better understand what the difference is between the vba and the formulas entered on the excel sheet.
Thanks again for everything and above all thanks for your time that you have dedicated to me.
Greetings to rurri with Friendship from A.Maurizio

 

publicado

Hi Antony
Not !
I would like to get a calendar on a form exactly as you proposed
only instead of moving the boxes of the names of the Week (Mon);(Tue);(Wed) etc...!
Make the numbers move only within the various Boxes exactly as you see in my calendar Proposed on the excel sheet.
Only that you should repeat the same thing but only in the form.

Another small example: I managed to put all the items you see in the column of the excel sheet ranging from (A1:A4) using only a Text to change the date from time to time.
Three Labels For (Day Month Year)
and a last Label which shows the date of the beginning of the current month.
Example: If today the date is shown in the text (01/17/2023) the last label is written like this (01/01/2023)
Now where is the problem !
That in the first label that makes up the scheme of our calendar; Exactly as you see it on the excel sheet
Because everything can work well even in the form
You should understand how to write this Code in vba format:" =A3-(WEEKDAY(A3,2)-1) "
Which in a nutshell would mean:
Get the number of the month that is on the Month label
Subtract it from the Day of the Week
And you transform it from the text format to the number 2 which corresponds to the day Of (Monday) minus 1 which to tell the truth I didn't quite understand why the excel formula you want it done this way that's all!
A bit like you can see in the image below

Only in this case it's at the level of the excl sheet
While I would like to do exactly that only using a form with its cells as labels

Link Project Now :
https://app.box.com/s/3nbyn726mwpduitfblk9ejlm35v8f0ll

  • 2 weeks later...
publicado

Hi Anthony how are you!
As always, you have outdone yourself

as your project is Beautiful and there is much more
As I noticed that: if you click on a Date it Generates Another Calendar
And all of this is wonderful
Thanks Infinite
Greetings to you and all the rest of your AyudaExcel Staff
From A.Maurizio

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

×
×
  • Crear nuevo...

Información importante

Echa un vistazo a nuestra política de cookies para ayudarte a tener una mejor experiencia de navegación. Puedes ajustar aquí la configuración. Pulsa el botón Aceptar, si estás de acuerdo.