Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I need a macro that I can assign to a button that when pressed will copy the text that is on that button into a cell. I'm stumped, ok well I didn't even try because I know I would be up all night trying then I'd ask anyway, so I'll just ask now. -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=560553 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It's difficult to know what 'the text' on the button is but as that is
unlikely to change this is how you would paste a constant text in a cell(s) Sub PutTextInCell() Selection.Value="MyText" End Sub Places MyText in the selected cell(s) -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk HIS "famdamly" wrote in message ... I need a macro that I can assign to a button that when pressed will copy the text that is on that button into a cell. I'm stumped, ok well I didn't even try because I know I would be up all night trying then I'd ask anyway, so I'll just ask now. -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=560553 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Thanks for the assistance. The text that I need entered into the cell is depending on which button I push. The text on the buttons will change depending on the users own customization. It's sort of my version of a drop down menu. Someone selects a cell, which is like a field in a form, they are zinged over to a screenfull of buttons, when they press one they are zinged back over to the form. Rather than a little drop down menu, I like to have larger selections to choose from thus allowing me the possibility of utilizing visual aids. That's just the way I like to navigate I guess. -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=560553 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is your form a worksheet designed to look like a form--or a real userform
(designed in the VBE)? I'm assuming that it's a worksheet. If you use a button from the forms toolbar, you can assign the same macro to each button. I'm not sure how you get from the selected cell to the worksheet with the button, but this may help: I put this in a General module: Option Explicit Public ActCell As Range Sub testme() Dim myBTN As Button Set myBTN = ActiveSheet.Buttons(Application.Caller) If ActCell Is Nothing Then Beep Else ActCell.Value = myBTN.Caption 'go back Application.Goto ActCell Set ActCell = Nothing End If End Sub I put this behind the worksheet that gets the captions: Option Explicit Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count 1 Then Exit Sub If Intersect(Target, Me.Range("a:a")) Is Nothing Then Exit Sub Set ActCell = Target Worksheets("sheetwithbuttons").Activate End Sub famdamly wrote: Thanks for the assistance. The text that I need entered into the cell is depending on which button I push. The text on the buttons will change depending on the users own customization. It's sort of my version of a drop down menu. Someone selects a cell, which is like a field in a form, they are zinged over to a screenfull of buttons, when they press one they are zinged back over to the form. Rather than a little drop down menu, I like to have larger selections to choose from thus allowing me the possibility of utilizing visual aids. That's just the way I like to navigate I guess. -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=560553 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |