MooseMoney
New Member
- Joined
- Jan 10, 2012
- Messages
- 34
I need some help to run a macro when the Close Button on my userform is clicked.
I need the macro to run prior to closing the userform. This is what I have, but it
does not work;
All help is appreciated!![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
.
I need the macro to run prior to closing the userform. This is what I have, but it
does not work;
Code:
Private Sub CloseButton_Click()
Range("UserFormResults!C17").Select
Selection.Copy
Range("UserFormResults!C30").Select
ActiveSheet.Paste
ActiveCell.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Application.CutCopyMode = False
Range("Costing!A1").Select
Unload Me
End Sub
All help is appreciated!
.