Can a macro be created to enter data into an inserted line?

Kizinti

New Member
Joined
Nov 30, 2005
Messages
43
Here is what I would like to do. I found the Worksheet_BeforeRightClick sub and thought it was awesome. When someone right-clicks, I want a box to come up with the question and buttons, "What do you want to do?" [button - add entry] [button - delete entry].

If [Add entry] is selected, I want a box to come up to have the user enter in the right data, then insert the line and the appropriate values.

If [Delete entry] is selected, I want the line deleted.

The reason is that I keep an ARCHIVE page that collects any changes to my spreadsheet. Currently, when a line is deleted, the next line is reported as the one that changed and not the one deleted. Also, when a line is inserted, the blank line is copied over, then each change is copied over. I just want it done once.

I found the code to insert and delete a line, and everything else I need to do. All I need is an interactive MsgBox. Any suggestions?

Kizinti
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
You will probably need to make our own userform because the message box options are very limited. You might want to try this :-
Code:
Sub test()
    rsp = MsgBox("Do you wish to insert a line ?" & vbCr _
        & "Yes to Insert" & vbCr _
        & "No to Delete", vbYesNoCancel)
    Select Case rsp
        Case Is = vbYes
            ' code to insert
            MsgBox ("Yes")
        Case Is = vbNo
            ' code to delete
            MsgBox ("No")
        Case Else
            Exit Sub
    End Select
End Sub
 
Upvote 0
Thanks BrianB,
This was my fist try, and it did work so thanks again. However, what my problem is, is that I want a box so when I select the [INSERT] option. a box comes up that I can lead the user to insert data( i.e. requirements name, test type, step number, etc.) and then insert the line, insert the data, and insert the behind the scenes formulas.

Any suggestions???

Thanks in advance
Kizinti
 
Upvote 0
Sorry to be so simpleminded ---
I didn't think it would be as easy as "inputBox"

Thanks anyway,
Kizinti
 
Upvote 0

Forum statistics

Threads
1,203,321
Messages
6,054,717
Members
444,746
Latest member
Emre06

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top