Create a button that adds data to the row

RafaInfo

New Member
Joined
Dec 22, 2020
Messages
4
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,

I need to create a excel file that will organize a give stock.
For each user, I have to assign the device and the give company.
Is it possible to create an "add" button which adds given Username,device and quantity to the line?

So if I press the button, if it's possible to have a popup asking for the username, another one for the device and the last one for the quantity.

Thank you
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You said:
Is it possible to create an "add" button which adds given Username,device and quantity to the line?

To the line?
What line.
Please add some specific details.
Like sheet name what column or and row
 
Upvote 0
Sorry for my english.
I mean; when I press the button, it will add username at A column (A1 for the first username), device at B column (B1 for the first device) and quantity at C column (C1 for the first given quantity).

If I press again "Add", it will add a new user,device and quantity in a new row (A2 for username, B2 for device and C2 for quantity).
 
Upvote 0
Would you like this:
It only requires one InputBox

When Input Box popsup

Enter values like this:

George,Clock,45

Notice you must enter a comma between each value.

If you don't like this I can write it to use three Inputboxes.

VBA Code:
Sub Enter_Data()
'Modified  12/22/2020  11:09:15 AM  EST
On Error GoTo M
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Dim ans As String
ans = InputBox("Enter Username Device Quanity ", "Like This:  George, Bulb, 45")
Dim LString As String
Dim LArray() As String
LString = ans
LArray = Split(LString, ",")
Cells(Lastrow, 1).Value = LArray(0)
Cells(Lastrow, 2).Value = LArray(1)
Cells(Lastrow, 3).Value = LArray(2)
Exit Sub
M:
MsgBox "We had a problem." & vbNewLine & "You entered" & vbNewLine & ans & vbNewLine & "You must enter a comma , between each value"

End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

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