Results 1 to 13 of 13

Checkbox Can I do This

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-22-2008
    Location
    S-o-t
    MS-Off Ver
    Office 2000 & 2010
    Posts
    166

    Checkbox Can I do This

    I have a userform that contains 15 labels, each label has Numbers in it each time i click on a label the text is inserted into an excel spreadsheet. I use it as a fast input solution and works well and has done for a few years.

    I Now want to Add three checkboxes to the userform
    If checkbox One is ticked i want the letter "A" and the number in the label i choose to be inserted into the spreadsheet.
    Checkbox Two "B"
    Checkbox Three "c"

    I would only ever tick one of the checkboxes never two or three so it would be A, B or C

    This is the code for The Labels i use

    private Sub Label4_Click()
    Call InsertTextSelection(Label4.Caption, RGB(0, 0, 255), 0)
    End Sub
    
    Private Sub Label5_Click()
    Call InsertTextSelection(Label5.Caption, RGB(0, 0, 0), 0)
    End Sub
    and so on

    This is the Call Insert textselection

    Public Sub InsertTextSelection(text, colour, hours)
        UserForm1.Hide
        r = Selection.Row
        c = Selection.Column
        Range(Cells(r, c - 0), Cells(r, c - 0)).Select
        With Selection
            .ClearContents
            .Font.Size = 9
            .Font.Color = colour
            .MergeCells = True
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlCenter
            .Value = text
        End With
        
        End Sub
    The userform works by doubleclick

    Hope you Can help

    Dave
    Last edited by Dave69rock; 08-25-2008 at 06:14 PM. Reason: wrap code

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. checkbox cell range change vba
    By novitaun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2008, 12:53 PM
  2. Checkbox and recalculate
    By lemonstar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-24-2008, 11:31 AM
  3. How to have Checkbox A uncheck with checked Checkbox B
    By Texas Aggie 09 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2007, 09:29 AM
  4. Checkbox - Date
    By bmasella in forum Excel General
    Replies: 1
    Last Post: 05-09-2007, 12:57 PM
  5. text box input and checkbox on user form
    By raw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2007, 05:27 PM

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