Hi all
Dead easy one for you. I'm trying to asssign whatever value is in the current active cell to my variable b.
I get a run-time error '91'
Cheers
Mark
Dead easy one for you. I'm trying to asssign whatever value is in the current active cell to my variable b.
Code:
Sub Macro1()
Dim a As Range, b As Range
Worksheets("Sheet1").Activate
Application.ScreenUpdating = False
ActiveCell.CurrentRegion.Select
ActiveCell.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
For Each a In Range("A2:A" & Range("A65536").End(xlUp).Row)
a.Value = Trim(a.Value)
ActiveCell.Offset(0, 1).Activate
b.Value = Trim(ActiveCell.Value)
Next a
End Sub
I get a run-time error '91'
Cheers
Mark