Tällainen lukujärjestys (tässä tiedon osoite)
http://personal.inet.fi/koti/kati/lukkari.htm
minulle annettiin ja pitäisi tehdä excelin VB:llä. Minulta loppui taju. Ensin pohdin if lausita ja sitten select case, vaan varmaan for i olisi se oikea tai yksinkertaisin vaihtoehto. Löytyisikö joltain apua asian ratkaisuun, jottei tarttisi näyttää ihan tyhmältä haasteen antajan edessä??
Kiitoksen etukäteen mahdollisille auttajille
Kuinka tällaisen teko onnistuu - auttaisiko joku
3
509
Vastaukset
- vb2005
Sub lasordning()
Dim i As Long, j As Long, veckor As Long
Dim dag As Variant
dag = Date
veckor = 2
For j = 1 To veckor
ActiveSheet.Cells(j * 7 - 6, 1).Value = "tid"
For i = 1 To 7
ActiveSheet.Cells(j * 7 - 6, i 1).Value = dag
dag = dag 1
Next i
Next j
End Sub- vb2005
Sub lasordning()
Dim i As Long, j As Long, veckor As Long
Dim dag As Variant
dag = Date
veckor = 2
For j = 1 To veckor
With ActiveSheet.Cells(j * 7 - 6, 1)
.Value = "tid"
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With
For i = 1 To 7
With ActiveSheet.Cells(j * 7 - 6, i 1)
.Value = Format(dag, "ddd d.m.yyyy", vbMonday, vbUseSystem)
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With
dag = dag 1
Next i
Next j
For i = xlEdgeLeft To xlInsideHorizontal
With ActiveSheet.Range(Cells(1, 1), Cells(veckor * 7, 8)).Borders(i)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next i
End Sub - vb2005
vb2005 kirjoitti:
Sub lasordning()
Dim i As Long, j As Long, veckor As Long
Dim dag As Variant
dag = Date
veckor = 2
For j = 1 To veckor
With ActiveSheet.Cells(j * 7 - 6, 1)
.Value = "tid"
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With
For i = 1 To 7
With ActiveSheet.Cells(j * 7 - 6, i 1)
.Value = Format(dag, "ddd d.m.yyyy", vbMonday, vbUseSystem)
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With
dag = dag 1
Next i
Next j
For i = xlEdgeLeft To xlInsideHorizontal
With ActiveSheet.Range(Cells(1, 1), Cells(veckor * 7, 8)).Borders(i)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next i
End SubSub lasordning()
Dim i As Long, j As Long, veckor As Long
Dim veckdag As Integer
Dim dag As Variant
dag = Date
veckdag = DatePart("w", dag, vbMonday, vbUseSystem)
If veckdag > 1 Then
dag = dag 8 - veckdag
End If
veckor = 2
For j = 1 To veckor
With ActiveSheet.Cells(j * 7 - 6, 1)
.Value = "tid"
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With
For i = 1 To 7
With ActiveSheet.Cells(j * 7 - 6, i 1)
.Value = Format(dag, "ddd d.m.yyyy", vbMonday, vbUseSystem)
.Interior.ColorIndex = 15
.Interior.Pattern = xlSolid
End With
dag = dag 1
Next i
Next j
For i = xlEdgeLeft To xlInsideHorizontal
With ActiveSheet.Range(Cells(1, 1), Cells(veckor * 7, 8)).Borders(i)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next i
End Sub
Ketjusta on poistettu 0 sääntöjenvastaista viestiä.
Luetuimmat keskustelut
Epäily: Oppilas puukotti kolmea Pirkkalan koululla
Tämänhetkisen tiedon mukaan ainakin kolme oppilasta on loukkaantunut puukotuksessa Pirkkalan Vähäjärven koululla. Myös e902717- 1041931
- 1191708
- 1451701
Jos olisit täällä
Tosin en tiiä miks oisit. (Ja hävettää muutenkin kun ei muka muulla tavoin osaa kertoa tätäkään) Jos jollain pienellä311661Kesän odotuksia hyrynsalmella
Kyllä kesällä hyrynsalmellakin on mahdollisuus osallistua kylän menoon monella tavalla . On kaunislehdon talomuseolla161659- 851597
Anne Kukkohovi ei myykkään pikkuhousujaan
Kyseessä oli vain markkinointitempaus. Anne höynäytti hienosti kaikkia ja Onlyfans-tilinsä tilaajamäärä lähti jyrkkään n2861405- 1191299
Voi Rakas siellä
Olet ollut mun ajatuksissa taas koko päivän. Olet ihmeellinen kertakaikkiaan ja arvostan sinua niin paljon❤️Minulla ei o241190