I need to find the last used column in my spreadsheet which i already have a working code for:
Sub Button2_Click()
Dim LastRow As Long, LastColumn As Integer
LastRow = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.Rows.Count).Row
LastColumn = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column
Columns(LastColumn).Select
End Sub
Then I need to find every 3rd cell in that column, i also have a code for this but i dont know how to make these work as one code as at the minute this is in a set column!
Sub Button1_Click()
Dim rRange As Range
Dim rEveryNth As Range
Dim lRow As Long
With Sheet1
Set rRange = .Range("c1", .Cells(.Rows.Count, "C").End(xlUp))
End With
For lRow = 1 To rRange.Rows.Count Step 3
If lRow = 1 Then
Set rEveryNth = rRange(lRow, 1)
Else
Set rEveryNth = Union(rRange(lRow, 1), rEveryNth)
End If
Next lRow
Application.Goto rEveryNth
End Sub
Please help
Sub Button2_Click()
Dim LastRow As Long, LastColumn As Integer
LastRow = ActiveSheet.UsedRange.Rows(ActiveSheet.UsedRange.Rows.Count).Row
LastColumn = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Column
Columns(LastColumn).Select
End Sub
Then I need to find every 3rd cell in that column, i also have a code for this but i dont know how to make these work as one code as at the minute this is in a set column!
Sub Button1_Click()
Dim rRange As Range
Dim rEveryNth As Range
Dim lRow As Long
With Sheet1
Set rRange = .Range("c1", .Cells(.Rows.Count, "C").End(xlUp))
End With
For lRow = 1 To rRange.Rows.Count Step 3
If lRow = 1 Then
Set rEveryNth = rRange(lRow, 1)
Else
Set rEveryNth = Union(rRange(lRow, 1), rEveryNth)
End If
Next lRow
Application.Goto rEveryNth
End Sub
Please help