Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Use Command Button from each Row to fill UserForm
I am new to VBA and need help on this issue that would be greatly
appreciated. I have a UserForm that has lots of text boxes (44) that I need to use to update cells in each row. I have a macro that puts a CommandButton at the beginning of each row with a caption name EDIT. I want the user to be able to click the EDIT button, and the UserForm pops up with all the data from that row the edit button is located on to be already in it. I also want the user to be able to edit the data in each cell using the UserForm textboxes, then click the "Apply" CommandButton to update the cells. The code I use for applying EDIT CommandButtons is below. Sub AddbtnEdit_Click() 'Adds Edit button to each row in Column A Dim cell As Range Dim btnEdit With Sheets("Global Production Schedule") LastRow = .Cells(.Rows.Count, "B").End(xlUp).Row For Each cell In Range(.Cells(3, "A"), .Cells(LastRow, "A")) Set btnEdit = .Buttons.Add(cell.Left, cell.Top, cell.Width, cell.Height) btnEdit.Caption = "Edit" & cell.Row btnEdit.OnAction = "AddbtnEdit" Next cell End With End Sub THANKS IN ADAVANCE!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
userform command button checkbox problem | Excel Programming | |||
need to minimize userform via command button on itself | Excel Programming | |||
How to elegantly end a main procedure from a userform command button? | Excel Programming | |||
Specifying a Command Button on a worksheet as differentiated from one on a UserForm | Excel Programming | |||
Userform disappears when you try to initialize from a command button | Excel Programming |