Results 1 to 9 of 9

Repeat buttons

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-28-2010
    Location
    quebec, canada
    MS-Off Ver
    o365
    Posts
    187

    Repeat buttons

    Hi everyone,

    I've got this piece of VBA that seems to do what i want:

    -------
    Sub CreateFormsButton()
    Dim btn As Button
    Dim rng As Range
    With Worksheets("hdcore1")
    Set rng = .Range("h4")
    Set btn = .Buttons.Add(rng.Left, rng.Top, rng.Width, rng.Height)
    With btn
    .Caption = "Coaching"
    .OnAction = "email sent"
    End With
    End With
    End Sub
    ----------

    It creates a button on the h4 cells with a "fit to cell size", can i modify this code to have this button create not only on h4, but i want this button to be on cell h4 to h1000. So i need to modify this code to do some sort of copy paste on multiple cell.

    If i modify the range to h4;h1000, it will create 1 cell the size of my request, but i need 1000 buttons in 1 code.

    Any help on how to loop or modify a quantity?

    thanks!
    Last edited by xatomicx; 10-29-2010 at 12:11 PM.

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