+ Reply to Thread
Results 1 to 9 of 9

Dynamic button creation

  1. #1
    mazzarin
    Guest

    Dynamic button creation

    Hi,

    I have a column of numbers in an excel sheet. They can be any set of
    numbers, but only within the range L15:L21

    Is it possible, for every non-empty cell (maybe on error resume next?),
    to create a button on top of the cell with the caption set as the
    number IN the cell, and for it to call a script mulby(cell.value here)

    Thanks for any assistance.


  2. #2
    Die_Another_Day
    Guest

    Re: Dynamic button creation

    Why not just one button?
    Sub ButtonMacro()
    Call mulby(ActiveCell.Value)
    End Sub

    HTH

    Die_Another_Day
    mazzarin wrote:
    > Hi,
    >
    > I have a column of numbers in an excel sheet. They can be any set of
    > numbers, but only within the range L15:L21
    >
    > Is it possible, for every non-empty cell (maybe on error resume next?),
    > to create a button on top of the cell with the caption set as the
    > number IN the cell, and for it to call a script mulby(cell.value here)
    >
    > Thanks for any assistance.



  3. #3
    mazzarin
    Guest

    Re: Dynamic button creation

    Due to the way the spreadsheet is organized and what the function mulby
    does, it needs to be seperate buttons for every value given.


    Die_Another_Day wrote:
    > Why not just one button?
    > Sub ButtonMacro()
    > Call mulby(ActiveCell.Value)
    > End Sub
    >
    > HTH
    >
    > Die_Another_Day
    > mazzarin wrote:
    > > Hi,
    > >
    > > I have a column of numbers in an excel sheet. They can be any set of
    > > numbers, but only within the range L15:L21
    > >
    > > Is it possible, for every non-empty cell (maybe on error resume next?),
    > > to create a button on top of the cell with the caption set as the
    > > number IN the cell, and for it to call a script mulby(cell.value here)
    > >
    > > Thanks for any assistance.



  4. #4
    Die_Another_Day
    Guest

    Re: Dynamic button creation

    Why not just one button?
    Sub ButtonMacro()
    Call mulby(ActiveCell.Value)
    End Sub

    HTH

    Die_Another_Day
    mazzarin wrote:
    > Hi,
    >
    > I have a column of numbers in an excel sheet. They can be any set of
    > numbers, but only within the range L15:L21
    >
    > Is it possible, for every non-empty cell (maybe on error resume next?),
    > to create a button on top of the cell with the caption set as the
    > number IN the cell, and for it to call a script mulby(cell.value here)
    >
    > Thanks for any assistance.



  5. #5
    mazzarin
    Guest

    Re: Dynamic button creation

    Due to the way the spreadsheet is organized and what the function mulby
    does, it needs to be seperate buttons for every value given.


    Die_Another_Day wrote:
    > Why not just one button?
    > Sub ButtonMacro()
    > Call mulby(ActiveCell.Value)
    > End Sub
    >
    > HTH
    >
    > Die_Another_Day
    > mazzarin wrote:
    > > Hi,
    > >
    > > I have a column of numbers in an excel sheet. They can be any set of
    > > numbers, but only within the range L15:L21
    > >
    > > Is it possible, for every non-empty cell (maybe on error resume next?),
    > > to create a button on top of the cell with the caption set as the
    > > number IN the cell, and for it to call a script mulby(cell.value here)
    > >
    > > Thanks for any assistance.



  6. #6
    mazzarin
    Guest

    Re: Dynamic button creation

    Just to elaborate, I originally had one button, but when I submitted it
    for review, people generally didn't like how that worked... they wanted
    multiple buttons so they didn't have to think/type. This is the best
    implementation I can think of for what was requested.


    mazzarin wrote:
    > Due to the way the spreadsheet is organized and what the function mulby
    > does, it needs to be seperate buttons for every value given.
    >
    >
    > Die_Another_Day wrote:
    > > Why not just one button?
    > > Sub ButtonMacro()
    > > Call mulby(ActiveCell.Value)
    > > End Sub
    > >
    > > HTH
    > >
    > > Die_Another_Day
    > > mazzarin wrote:
    > > > Hi,
    > > >
    > > > I have a column of numbers in an excel sheet. They can be any set of
    > > > numbers, but only within the range L15:L21
    > > >
    > > > Is it possible, for every non-empty cell (maybe on error resume next?),
    > > > to create a button on top of the cell with the caption set as the
    > > > number IN the cell, and for it to call a script mulby(cell.value here)
    > > >
    > > > Thanks for any assistance.



  7. #7
    Die_Another_Day
    Guest

    Re: Dynamic button creation

    What about using the before double-click event? Then all your lazy
    users have to do is double click the cell they want.

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
    As Boolean)
    If Not Intersect(Target, Range("L15:L21")) Is Nothing Then
    If Target.Value <> "" Then
    Call Mulby(Target.Value)
    End If
    End If
    End Sub

    if that doesn't work let me know when you want to create the buttons
    and I will help you write the code.

    Die_Another_Day
    mazzarin wrote:
    > Just to elaborate, I originally had one button, but when I submitted it
    > for review, people generally didn't like how that worked... they wanted
    > multiple buttons so they didn't have to think/type. This is the best
    > implementation I can think of for what was requested.
    >
    >
    > mazzarin wrote:
    > > Due to the way the spreadsheet is organized and what the function mulby
    > > does, it needs to be seperate buttons for every value given.
    > >
    > >
    > > Die_Another_Day wrote:
    > > > Why not just one button?
    > > > Sub ButtonMacro()
    > > > Call mulby(ActiveCell.Value)
    > > > End Sub
    > > >
    > > > HTH
    > > >
    > > > Die_Another_Day
    > > > mazzarin wrote:
    > > > > Hi,
    > > > >
    > > > > I have a column of numbers in an excel sheet. They can be any set of
    > > > > numbers, but only within the range L15:L21
    > > > >
    > > > > Is it possible, for every non-empty cell (maybe on error resume next?),
    > > > > to create a button on top of the cell with the caption set as the
    > > > > number IN the cell, and for it to call a script mulby(cell.value here)
    > > > >
    > > > > Thanks for any assistance.



  8. #8
    mazzarin
    Guest

    Re: Dynamic button creation

    That works! Hopefully everything goes well now.

    Thanks.

    Die_Another_Day wrote:
    > What about using the before double-click event? Then all your lazy
    > users have to do is double click the cell they want.
    >
    > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
    > As Boolean)
    > If Not Intersect(Target, Range("L15:L21")) Is Nothing Then
    > If Target.Value <> "" Then
    > Call Mulby(Target.Value)
    > End If
    > End If
    > End Sub
    >
    > if that doesn't work let me know when you want to create the buttons
    > and I will help you write the code.
    >
    > Die_Another_Day
    > mazzarin wrote:
    > > Just to elaborate, I originally had one button, but when I submitted it
    > > for review, people generally didn't like how that worked... they wanted
    > > multiple buttons so they didn't have to think/type. This is the best
    > > implementation I can think of for what was requested.
    > >
    > >
    > > mazzarin wrote:
    > > > Due to the way the spreadsheet is organized and what the function mulby
    > > > does, it needs to be seperate buttons for every value given.
    > > >
    > > >
    > > > Die_Another_Day wrote:
    > > > > Why not just one button?
    > > > > Sub ButtonMacro()
    > > > > Call mulby(ActiveCell.Value)
    > > > > End Sub
    > > > >
    > > > > HTH
    > > > >
    > > > > Die_Another_Day
    > > > > mazzarin wrote:
    > > > > > Hi,
    > > > > >
    > > > > > I have a column of numbers in an excel sheet. They can be any set of
    > > > > > numbers, but only within the range L15:L21
    > > > > >
    > > > > > Is it possible, for every non-empty cell (maybe on error resume next?),
    > > > > > to create a button on top of the cell with the caption set as the
    > > > > > number IN the cell, and for it to call a script mulby(cell.value here)
    > > > > >
    > > > > > Thanks for any assistance.



  9. #9
    mazzarin
    Guest

    Re: Dynamic button creation

    That works! Hopefully everything goes well now.

    Thanks.

    Die_Another_Day wrote:
    > What about using the before double-click event? Then all your lazy
    > users have to do is double click the cell they want.
    >
    > Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
    > As Boolean)
    > If Not Intersect(Target, Range("L15:L21")) Is Nothing Then
    > If Target.Value <> "" Then
    > Call Mulby(Target.Value)
    > End If
    > End If
    > End Sub
    >
    > if that doesn't work let me know when you want to create the buttons
    > and I will help you write the code.
    >
    > Die_Another_Day
    > mazzarin wrote:
    > > Just to elaborate, I originally had one button, but when I submitted it
    > > for review, people generally didn't like how that worked... they wanted
    > > multiple buttons so they didn't have to think/type. This is the best
    > > implementation I can think of for what was requested.
    > >
    > >
    > > mazzarin wrote:
    > > > Due to the way the spreadsheet is organized and what the function mulby
    > > > does, it needs to be seperate buttons for every value given.
    > > >
    > > >
    > > > Die_Another_Day wrote:
    > > > > Why not just one button?
    > > > > Sub ButtonMacro()
    > > > > Call mulby(ActiveCell.Value)
    > > > > End Sub
    > > > >
    > > > > HTH
    > > > >
    > > > > Die_Another_Day
    > > > > mazzarin wrote:
    > > > > > Hi,
    > > > > >
    > > > > > I have a column of numbers in an excel sheet. They can be any set of
    > > > > > numbers, but only within the range L15:L21
    > > > > >
    > > > > > Is it possible, for every non-empty cell (maybe on error resume next?),
    > > > > > to create a button on top of the cell with the caption set as the
    > > > > > number IN the cell, and for it to call a script mulby(cell.value here)
    > > > > >
    > > > > > Thanks for any assistance.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1