Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
PBS
 
Posts: n/a
Default Control Toolbox button

I hope I can explain this well. What I'm wanting to do is put a button from
the Control Toolbox into multiple fields on a spreadsheet. If I click the
button, then I want it to highlight the four fields next to it. Also, if
possible I would like to have it then copy that selection to a different
worksheet within the workbook. I hope I explained it well enough. If not,
please post a reply and I will try to explain it better. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Control Toolbox button

You may be better off using a button from the Forms Toolbar.

That way you can assign the same macro to all those buttons.

This may give you a few ideas to play with:

Option Explicit
Sub testme01()

Dim myBTN As Button
Dim DestCell As Range
Dim RngToCopy As Range

Set myBTN = ActiveSheet.Buttons(Application.Caller)

'what does next to mean?
Set RngToCopy = myBTN.TopLeftCell.Offset(0, 5).Resize(1, 4)

If RngToCopy.Cells.Count = Application.CountA(RngToCopy) Then
With ActiveSheet.Parent.Worksheets("sheet2")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp)
End With

RngToCopy.Copy _
Destination:=DestCell

RngToCopy.Select
Else
Beep
MsgBox "Please fill in those 4 cells"
End If

End Sub

PBS wrote:

I hope I can explain this well. What I'm wanting to do is put a button from
the Control Toolbox into multiple fields on a spreadsheet. If I click the
button, then I want it to highlight the four fields next to it. Also, if
possible I would like to have it then copy that selection to a different
worksheet within the workbook. I hope I explained it well enough. If not,
please post a reply and I will try to explain it better. Thanks in advance.


--

Dave Peterson
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
HOW DO I GIVE A CONTROL TOOLBOX CHECKBOX A VALUE IN EXCEL? Paula Excel Worksheet Functions 0 March 6th 06 04:31 PM
Vanishing Control Toolbox Command Buttons Fritz24 Excel Discussion (Misc queries) 2 June 7th 05 01:39 PM
Forms Toolbar vs. Control Toolbox vs. Data Validation for drop dow Scott Excel Discussion (Misc queries) 1 February 1st 05 01:51 PM
Embed command button from the control toolbox doesnt work guichre Excel Worksheet Functions 1 November 16th 04 02:28 AM
Embed command button from the control toolbox doesnt work Roland Excel Worksheet Functions 0 November 16th 04 02:20 AM


All times are GMT +1. The time now is 03:10 PM.

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

About Us

"It's about Microsoft Excel"