chriswernau
New Member
- Joined
- Sep 3, 2014
- Messages
- 2
Hi,
I have got problem with loop. I fill the row with workdays from current month and I would like to stop doing that, before it add a date from next month.
So, first possibile condition would be somenthing like that : month(myird)>month(Now())
Or second. One row above I've got these days and at the end of the row is string cell "Summe", so the loop may stop, when encounters this cell.
Function Filltable(adresse As String, rownumber As Integer)
Dim kolumn, m As Double
For kolumn = 3 To 25
Do While Cells(rownumber - 1, kolumn).value = "Summe"
m = m + 1
myird = Format(WorksheetFunction.WorkDay(Int(Now()), -2 + m), "dd/mm/yyyy")
Cells(rownumber, kolumn) = "=" & Chr(39) & myird & Chr(39) & "!" & Range(adresse).address
Loop
Next kolumn
End Function
Any sugestions?
I have got problem with loop. I fill the row with workdays from current month and I would like to stop doing that, before it add a date from next month.
So, first possibile condition would be somenthing like that : month(myird)>month(Now())
Or second. One row above I've got these days and at the end of the row is string cell "Summe", so the loop may stop, when encounters this cell.
Function Filltable(adresse As String, rownumber As Integer)
Dim kolumn, m As Double
For kolumn = 3 To 25
Do While Cells(rownumber - 1, kolumn).value = "Summe"
m = m + 1
myird = Format(WorksheetFunction.WorkDay(Int(Now()), -2 + m), "dd/mm/yyyy")
Cells(rownumber, kolumn) = "=" & Chr(39) & myird & Chr(39) & "!" & Range(adresse).address
Loop
Next kolumn
End Function
Any sugestions?