# Thread: devide calendar in variuos steep... (2000 sr 1)

1. ## devide calendar in variuos steep... (2000 sr 1)

i would want to populate the table after the insertion of the year in A1 in this mode...

the column B C and D is the first ten days, second ten days, third ten days(in this case is the last days of month)

the column E and F is the first fifteen days, second fifteen days (in this case is the last days of month)

the column G is the last days of month

2. ## Re: devide calendar vin variuos steep... (2000 sr 1)

What do you want the cells to contain?
- The first day of each period
- The last day of each period
- The middle day of each period

3. ## Re: devide calendar vin variuos steep... (2000 sr 1)

Hi Hans, not understand completly, you:-(
If you see the table the B C D column is first day the twentieth and last one
the column E F the fifteenth and last one
the column G last one
In the column A is the month of reference...

4. ## Re: devide calendar vin variuos steep... (2000 sr 1)

I certainly don't understand. Try the attached version.

5. ## Re: devide calendar vin variuos steep... (2000 sr 1)

Tthis is perfect....
But i am not sure if is possible to get a part of value from each cells...
In effect you have maked the solution with a formula.
If i would want to get a part of cell for example with a mid or left instruction in VBA is possible or the vba not recognize the value into cell because is present a formula and not a value similar a text?
I hope i am clear;.(

6. ## Re: devide calendar vin variuos steep... (2000 sr 1)

What do you want to accomplish? What "part of cell" do you need and what do you want to do with it?

7. ## Re: devide calendar vin variuos steep... (2000 sr 1)

For this "What "part of cell" do you need and what do you want to do with it?"

From the range B2 to G13

And i can use the part of the cell only if is a txt value because i insert in a screen terminal and it accpt only txt value...

8. ## Re: devide calendar vin variuos steep... (2000 sr 1)

It should work OK if you copy and paste. Otherwise:

Try this:
- Format A2:G13 as Text.
- Right-click the sheet tab of the DATE sheet and select View Code.
- Copy the following code into the worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Dim y As Long
If Not Intersect(Target, Range("A1")) Is Nothing Then
y = Range("A1")
For i = 2 To 13
Range("A" & i) = CStr(DateSerial(y, i - 1, 1))
Range("B" & i) = CStr(DateSerial(y, i - 1, 1))
Range("C" & i) = CStr(DateSerial(y, i - 1, 10))
Range("D" & i) = CStr(DateSerial(y, i, 0))
Range("E" & i) = CStr(DateSerial(y, i - 1, 15))
Range("F" & i) = CStr(DateSerial(y, i, 0))
Range("G" & i) = CStr(DateSerial(y, i, 0))
Next i
End If
End Sub

- Type a year in cell A1 to see the values change.

9. ## Re: devide calendar vin variuos steep... (2000 sr 1)

how!!!
But i have maked a error from the column B C D the first step is ten and not the first day of the month of the month attached your last xls correct.
Sorry for error.

10. ## Re: devide calendar vin variuos steep... (2000 sr 1)

Change

Range("B" & i) = CStr(DateSerial(y, i - 1, 1))
Range("C" & i) = CStr(DateSerial(y, i - 1, 10))

to

Range("B" & i) = CStr(DateSerial(y, i - 1, 10))
Range("C" & i) = CStr(DateSerial(y, i - 1, 20))

11. ## Re: devide calendar vin variuos steep... (2000 sr 1)

HUmmmmm...
The column B not is the first step by ten....
And the macro change also the value into column A.
Peraphs i have maked still an error?
in column I i have insert that i want.
Boh!

12. ## Re: devide calendar vin variuos steep... (2000 sr 1)

Do you want the dates to be in USA date format (today is 10/25/2005) or in European date format (today is 25/10/2005)?

13. ## Re: devide calendar vin variuos steep... (2000 sr 1)

... in European date format (today is 25/10/2005), tks.

I have see the macro change the value into column A, Why?

Note:
But if for you is must simple insert into coilumn A only the month naturally is referend from cell A1, and not 01/01/2005, 01/02/2005 ecc....

GENNAIO
FEBBRAIO
MARZO
APRILE
MAGGIO
GIUGNO
LUGLIO
AGOSTO
SETTEMBRE
OTTOBRE
NOVEMBRE
DICEMBRE

14. ## Re: devide calendar vin variuos steep... (2000 sr 1)

Format B2:G13 as text, as I wrote before.

15. ## Re: devide calendar vin variuos steep... (2000 sr 1)

Sory Hans i am a stupid, now i have see with attention your last post 528895, sorry.
Now all work fine.

Page 1 of 3 123 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•