Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 586
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
userform command button checkbox problem [email protected] Excel Programming 1 February 1st 07 02:35 PM
need to minimize userform via command button on itself Jed[_3_] Excel Programming 1 August 10th 06 09:39 PM
How to elegantly end a main procedure from a userform command button? [email protected] Excel Programming 1 August 2nd 06 11:54 PM
Specifying a Command Button on a worksheet as differentiated from one on a UserForm Amber_D_Laws[_52_] Excel Programming 14 February 7th 06 03:43 PM
Userform disappears when you try to initialize from a command button RPIJG[_60_] Excel Programming 8 July 2nd 04 08:14 PM


All times are GMT +1. The time now is 05:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"