I have a macro created that works fine. However, when I try to get it to run from an ActiveX button, it does not work at all.
Is there a certain mode or option I have to toggle to get it to work?
Macro is as follows:
VB:
Sub Combine()
Application.ScreenUpdating = False
Sheets("Sheet3").Select
Columns("J:J").Select
Selection.ClearContents
Sheets("Sheet2").Select
Range("C2:C1500").Select
Selection.Copy
Sheets("Sheet3").Select
Range("J2").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("C2:C1500").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet3").Select
Range("J2").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveSheet.Paste
Columns("J:J").Select
Application.CutCopyMode = False
ActiveSheet.Range("$J$1:$J$3157").RemoveDuplicates Columns:=1, Header:=xlNo
ActiveWorkbook.Worksheets("Sheet3").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet3").Sort.SortFields.Add Key:=Range("J1:J3157") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet3").Sort
.SetRange Range("J1:J3157")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Thanks in advance,
Bookmarks