Insert text into column 3 of newly inserted row using input box

lanziniad

New Member
Joined
Nov 7, 2011
Messages
16
Hello all,

What I am searching for is how to have a user insert text using an input box into the row they just inserted via input box.

An input box asks user which row to insert new row.
then an input asks what text to input into that row on column 3.

here is the code im using to input new row, found this online and it works great.

<code>

Private Sub CommandButton7_Click()
On Error GoTo err_Fix:
Dim myInsertRow As Long

myInsertRow = InputBox("Which row would you like to place a new row in?", "Insert new row")
If (myInsertRow > 0) And (myInsertRow < 65536) Then
Rows(myInsertRow).EntireRow.Insert
Else
MsgBox "You have entered an invalid row number"
End If
Exit Sub
err_Fix:
If Err.Number = 13 Then
MsgBox "You have entered an invalid row number"
Else
MsgBox Err.Number & ": " & Err.Description
End If

End Sub

</code>

thank you for all your help.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
(SOLVED) Re: Insert text into column 3 of newly inserted row using input box

Thanks but I figured it out..

I added the red code, and it worked great.

myInsertRow = InputBox("Which row would you like to place a new row in?", "Insert new row")
If (myInsertRow > 0) And (myInsertRow < 65536) Then
Rows(myInsertRow).EntireRow.Insert


Columns(3).Rows(myInsertRow).Select
inputReq = Selection.Application.InputBox("Enter Text")
ActiveCell.Value = inputReq


Thanks, maybe this will help someone else.:):)
 
Upvote 0

Forum statistics

Threads
1,215,459
Messages
6,124,948
Members
449,198
Latest member
MhammadishaqKhan

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