If Then Else Statement

Aaron

Board Regular
Joined
Feb 20, 2002
Messages
237
I have the following code in a print macro:
Code:
    If Selection = "M65519" Then
        Endrange = "M35"
    Else
        Range("M35").End(xlDown).Select
        Endrange = ActiveCell.Address
    End If
The user will select multiple items in column n. The macro sorts and prints the selected items. If only one item is select my macro prints the entire worksheet. What I am looking to fix is it one item is select print that row after the sort, if multiple items, then print multiple items after the sort. Thanks in advance for any help given.
 

Some videos you may like

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Aaron

Board Regular
Joined
Feb 20, 2002
Messages
237
I used this instead, thanks anyway for your help
Code:
    If ActiveCell = 0 Then
        Endrange = "M35"
    Else
        Range("M35").End(xlDown).Select
        Endrange = ActiveCell.Address
    End If
 

Watch MrExcel Video

Forum statistics

Threads
1,118,323
Messages
5,571,544
Members
412,402
Latest member
xam99
Top