E
et
I would like to write a VBA to make some copies automatically. The range is
to be selected based on a cell's value.
For example :
if A1 = "General Admin" Then print area named "GA"
if A1 = "Sales Admin" Then print area named "SA"
My VBA is :
Dim x As String
If ActiveCell.Value = "General Management" Then
x = "GA"
ElseIf ActiveCell.Value = "Sales Admin." Then
x = "SA"
ElseIf ActiveCell.Value = "Beijing" Then
x = "BJ"
ElseIf ActiveCell.Value = "Shanghai" Then
x = "SH"
End If
Range(x).Select
I guess I chose the wrong data type but not sure which one is correct. Could
anyone help, thanks.
et
to be selected based on a cell's value.
For example :
if A1 = "General Admin" Then print area named "GA"
if A1 = "Sales Admin" Then print area named "SA"
My VBA is :
Dim x As String
If ActiveCell.Value = "General Management" Then
x = "GA"
ElseIf ActiveCell.Value = "Sales Admin." Then
x = "SA"
ElseIf ActiveCell.Value = "Beijing" Then
x = "BJ"
ElseIf ActiveCell.Value = "Shanghai" Then
x = "SH"
End If
Range(x).Select
I guess I chose the wrong data type but not sure which one is correct. Could
anyone help, thanks.
et