edwardzbrown
New Member
- Joined
- Jun 12, 2017
- Messages
- 20
Hello,
I have a setup where: a button function will bring in a row from a template sheet. After that row in inserted above the button, I want one of two things to happen. Either that button deletes itself, and I can have the new button copied over OR I want that button to replace itself with the other button that I have. Like replace this module with this module. Sample of where I'm at below:
Sub Button24_Click() 'Arch Review
' Add Revision Button. Inserts another revision row at the bottom of each entry field where the button is located.
'Variable Declaration
Dim OutPut As Integer
'Example of vbYesNoCancel
OutPut = MsgBox("Does Architect Accept CNA Entry? ''Yes'' will indicate CNA entry as accepted. ''No'' will create Architect Revision Field.", vbQuestion + vbYesNoCancel, "Architect Entry Only")
If OutPut = 6 Then
'Output = 6(Yes)
MsgBox "New Entry Range Created"
MsgBox "CNA input has been marked as Accepted", vbInformation, "A-SCR2"
'I'll make code here eventually to change the color of the font on the button from RED to GREEN as an indication that the entry was reviewed and accepted.
ElseIf OutPut = 7 Then
'Output = 7(No)
' Mainlineup Macro
Dim b As Object, cs As Integer
Set b = ActiveSheet.Buttons(Application.Caller)
With b.TopLeftCell
cs = .Row
End With
'Insert template Entry from another Work Sheet
Worksheets("Templates").Rows("18:19").Copy
ActiveSheet.Rows(cs).Insert Shift:=xlDown
'delete row above - This isn't really working for me, but I keep it here in case this is what I need to make this work out the way I want.
' ActiveSheet.Rows(cs).EntireRow.Delete
'delete myself - This is the part I need help with. I want this button to go away, so that it won't overlap the new button I just copied from a template, or to swap this button with the button I want to occupy this space now.
MsgBox "New Architect Revision Field Created", vbInformation, "A-SCR2"
Else
'Cancel. No need for anything. Else nothing.
End If
End Sub
Thanks for all your help!
I have a setup where: a button function will bring in a row from a template sheet. After that row in inserted above the button, I want one of two things to happen. Either that button deletes itself, and I can have the new button copied over OR I want that button to replace itself with the other button that I have. Like replace this module with this module. Sample of where I'm at below:
Sub Button24_Click() 'Arch Review
' Add Revision Button. Inserts another revision row at the bottom of each entry field where the button is located.
'Variable Declaration
Dim OutPut As Integer
'Example of vbYesNoCancel
OutPut = MsgBox("Does Architect Accept CNA Entry? ''Yes'' will indicate CNA entry as accepted. ''No'' will create Architect Revision Field.", vbQuestion + vbYesNoCancel, "Architect Entry Only")
If OutPut = 6 Then
'Output = 6(Yes)
MsgBox "New Entry Range Created"
MsgBox "CNA input has been marked as Accepted", vbInformation, "A-SCR2"
'I'll make code here eventually to change the color of the font on the button from RED to GREEN as an indication that the entry was reviewed and accepted.
ElseIf OutPut = 7 Then
'Output = 7(No)
' Mainlineup Macro
Dim b As Object, cs As Integer
Set b = ActiveSheet.Buttons(Application.Caller)
With b.TopLeftCell
cs = .Row
End With
'Insert template Entry from another Work Sheet
Worksheets("Templates").Rows("18:19").Copy
ActiveSheet.Rows(cs).Insert Shift:=xlDown
'delete row above - This isn't really working for me, but I keep it here in case this is what I need to make this work out the way I want.
' ActiveSheet.Rows(cs).EntireRow.Delete
'delete myself - This is the part I need help with. I want this button to go away, so that it won't overlap the new button I just copied from a template, or to swap this button with the button I want to occupy this space now.
MsgBox "New Architect Revision Field Created", vbInformation, "A-SCR2"
Else
'Cancel. No need for anything. Else nothing.
End If
End Sub
Thanks for all your help!