D
David
I am using a macro Simon wrote. Its written to format an address fiel
depending upon a cell value. This macro execute randomly. I would lik
to convert it to a button click. So the user can execute it themselve
when they need it. Thanks for all your help.
Code
-------------------
Sub item1(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address <> "$H$12" Then Exit Sub
If Me.Range("H12") <> "" Then
With Sheets("2-10000 Order and Cover")
.Range("B67").Value = Me.Range("H11").Value
.Range("B68").Value = "Re: " & Me.Range("H6").Value
.Range("B69").Value = Me.Range("H12").Value
.Range("B70").Value = Me.Range("a600").Value & " "
.Range("B70").Value = Me.Range("H13").Value & ", " _
& Me.Range("I13").Value & ", " _
& Me.Range("J13").Value
End With
Else
With Sheets("2-10000 Order and Cover")
.Range("B67").Value = Me.Range("H6").Value
.Range("B68").Value = Me.Range("H9").Value
.Range("B69").Value = Me.Range("H10").Value & ", " _
& Me.Range("I10").Value & ", " _
& Me.Range("J10").Value
.Range("B70").Value = Me.Range("a600").Value & " "
End With
End If
End Sub
depending upon a cell value. This macro execute randomly. I would lik
to convert it to a button click. So the user can execute it themselve
when they need it. Thanks for all your help.
Code
-------------------
Sub item1(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Target.Address <> "$H$12" Then Exit Sub
If Me.Range("H12") <> "" Then
With Sheets("2-10000 Order and Cover")
.Range("B67").Value = Me.Range("H11").Value
.Range("B68").Value = "Re: " & Me.Range("H6").Value
.Range("B69").Value = Me.Range("H12").Value
.Range("B70").Value = Me.Range("a600").Value & " "
.Range("B70").Value = Me.Range("H13").Value & ", " _
& Me.Range("I13").Value & ", " _
& Me.Range("J13").Value
End With
Else
With Sheets("2-10000 Order and Cover")
.Range("B67").Value = Me.Range("H6").Value
.Range("B68").Value = Me.Range("H9").Value
.Range("B69").Value = Me.Range("H10").Value & ", " _
& Me.Range("I10").Value & ", " _
& Me.Range("J10").Value
.Range("B70").Value = Me.Range("a600").Value & " "
End With
End If
End Sub