Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"arceaf" wrote:
I'm having a bit of difficulty merging two different VBA functions into one button. Please explain the "difficulty". I presume you already tried copying and pasting the text of second macro into the text of the first macro. In what way does that not do what you expect? "arceaf" wrote: This the the button code: [....] And this is the other VBA code: Why "merge" the code at all? Why not simply call the second macro at the end of the first macro? See below. In what way does that not do what you expect? Private Sub CommandButton2_Click() With Sheets("Recommendations Calc").Range("A" & Rows.Count).End(xlUp) ..Offset(1, 0).Value = Sheets("Decision Matrix").Range("C2").Value ..Offset(1, 1).Value = Sheets("Decision Matrix").Range("h55").Value ..Offset(1, 4).Value = Sheets("Decision Matrix").Range("I55").Value '<--call the macro to delete the dup. and put the last data entry. deletedup End With thebigcopy ' <-- added End Sub (Aside: I would put the call to "deletedup" after End With.) PS: "thebigcopy" changes the active worksheet. It might be prudent to modify it so that it goes back to the original active worksheet. To wit: Sub thebigcopy() Dim oldWS as Worksheet Set oldWS = Activesheet ' <-- remember initial active worksheet [....] oldWS.Activate ' <-- restore initial active worksheet End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need some help with codes | Excel Discussion (Misc queries) | |||
When merging information not merging correctly | Excel Worksheet Functions | |||
Merging Two Codes Into one code | Excel Programming | |||
re : Help Need on my codes | Excel Programming | |||
Sorting, Merging, and Re-merging | Excel Worksheet Functions |