crossy5575
Registered User.
- Local time
- Today, 23:49
- Joined
- Apr 21, 2015
- Messages
- 46
Hi there,
following on from a previous thread i am trying to have a number of temporary variables simultaneously.
This use would be take a concatenated string and make it a variable within a loop
Dim m1days As Integer
Dim m2days As Integer
Dim m3days As Integer
in this case - xroup = "m" & cc & "days" = m1days m2days m3days and so on as the loop continues
Thus for 12 months of the year i could store 12 variables, apply them, then clear them and add another 12 variables.
Another use would be to take a variable string and then make them into an array to be used later on in a form.
The question is what do you define xroup as to enable it to store it as m1days which itself has an integer attached to it?
can anyone help load the variable variable please?
thanks
Simon
following on from a previous thread i am trying to have a number of temporary variables simultaneously.
This use would be take a concatenated string and make it a variable within a loop
Dim m1days As Integer
Dim m2days As Integer
Dim m3days As Integer
in this case - xroup = "m" & cc & "days" = m1days m2days m3days and so on as the loop continues
Thus for 12 months of the year i could store 12 variables, apply them, then clear them and add another 12 variables.
Another use would be to take a variable string and then make them into an array to be used later on in a form.
The question is what do you define xroup as to enable it to store it as m1days which itself has an integer attached to it?
PHP:
Private Sub initvariables()
Dim m1days As Integer
Dim m2days As Integer
Dim m3days As Integer
Dim m4days As Integer
Dim m5days As Integer
Dim m6days As Integer
Dim m7days As Integer
Dim m8days As Integer
Dim m9days As Integer
Dim m10days As Integer
Dim m11days As Integer
Dim m12days As Integer
Dim firstmon1 As Long
Dim firstmon2 As Long
Dim firstmon3 As Long
Dim firstmon4 As Long
Dim firstmon5 As Long
Dim firstmon6 As Long
Dim firstmon7 As Long
Dim firstmon8 As Long
Dim firstmon9 As Long
Dim firstmon10 As Long
Dim firstmon11 As Long
Dim firstmon12 As Long
Dim mdate2 As String
Dim cc As Integer
Dim dd As Integer
Dim xroup As Variant
Dim yroup As Variant
intmonth = 5 'Me.cbomonth'
intyear = 2016 'Me.cboyear'
If todayx = 1 Then
firstdate = CLng(DateSerial(intyear, intmonth, Day(Date)))
Else
firstdate = CLng(DateSerial(intyear, intmonth, 1))
End If
dd = 0
For cc = 1 To 12
'get number of days in each of the 3 months that we are looking at'
If cc = 1 Then
xroup = "m" & cc & "days"
Set xroup = DateDiff("d", firstdate, DateAdd("m", cc, firstdate))
dd = dd + Controls(xroup)
yroup = "firstmon" & cc
temp = getfirstweekday(firstdate + dd)
yroup = firstdate + dd - temp + 1
End If
Next cc
End Sub
can anyone help load the variable variable please?
thanks
Simon