Robert Smidt
Gebruiker
- Lid geworden
- 26 mei 2009
- Berichten
- 947
Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Sub WisRijen()
lastcolumn = Cells.SpecialCells(xlLastCell).Column
For r = 6 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(r, 2) = "" Then Range(Cells(r, 2), Cells(r, lastcolumn)).ClearContents
Next
End Sub
Sub wisLegeCellenInKolomB()
Set Rng = Range(Range("b6"), Range("b" & Rows.Count).End(xlUp))
a = Rng.Value
Rng.Clear
r = 6
For i = 1 To UBound(a)
If a(i, 1) <> "" Then
Cells(r, 2) = a(i, 1)
r = r + 1
End If
Next
End Sub
r = 6
For i = 1 To UBound(a)
If a(i, 1) <> "" Then
Cells(r, 2) = a(i, 1)
r = r + 1
End If
Sub wisLegeCellenInKolomB()
' Define the range Rng starting from cell B6 down to the last non-empty cell in column B
Set Rng = Range(Range("b6"), Range("b" & Rows.Count).End(xlUp))
' Store the values from the defined range into a 2D array variable 'a'
a = Rng.Value
' Clear the contents of the original range to prepare for rewriting
Rng.Clear
' Start writing back non-empty values to column B, starting at row 6
r = 6
' Loop through each row in the array (first column of the array)
For i = 1 To UBound(a)
' If the cell value is not empty
If a(i, 1) <> "" Then
' Write the non-empty value back into the worksheet in column B
Cells(r, 2) = a(i, 1)
' Move to the next row
r = r + 1
End If
Next
End Sub
Sub th()
Dim Nary As Variant, DataOld
Dim r As Long, nr As Long
With Sheets("Ist")
DataOld = .Range("B6", .Range("B" & .Rows.Count).End(xlUp))
ReDim Nary(1 To UBound(DataOld), 1 To 1)
For r = 1 To UBound(DataOld)
If DataOld(r, 1) <> "" Then
nr = nr + 1: Nary(nr, 1) = DataOld(r, 1)
End If
Next r
.Range("B6", .Range("B" & .Rows.Count).End(xlUp)).ClearContents
.Range("B6").Resize(nr, 1).Value = Nary
End With
End Sub
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.