Results 1 to 2 of 2

How do I specify which Labels I want to change?

Threaded View

  1. #1
    Registered User
    Join Date
    09-19-2021
    Location
    Singapore
    MS-Off Ver
    2013
    Posts
    15

    How do I specify which Labels I want to change?

    I'm trying to make Labels 27-33 read L36:L42 when I click the Assign button but somehow my other labels get changed and I'm not sure how to fix this.
    Here is my userform, left is before I click Assign and right is after. Thank you!
    photo1632445539 (1).jpeg
    and here is my code, cmbassign is the Assign command button
    Private Sub cmbassign_Click()
    Call chgassign
    End Sub
    
    Sub chgassign()
    i = 1
    Set rg = Range("L36")
    Set rg = Range("L37")
    Set rg = Range("L38")
    Set rg = Range("L39")
    Set rg = Range("L40")
    Set rg = Range("L41")
    Set rg = Range("L42")
    For Each ctrl In Me.Controls
    If TypeName(ctrl) = "Label" And ctrl.Name = "Label3" & CStr(i - 1) Then
    ctrl.Caption = rg(i).Value
    i = i + 1
    End If
    Next
    End Sub
    Last edited by shuxin; 09-23-2021 at 10:38 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Can't change x-axis labels
    By getravel in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 06-15-2019, 05:51 PM
  2. Change chart/pivot table numeric labels to associated text labels
    By petschek in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-07-2014, 05:32 PM
  3. change x axis labels
    By random379 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2013, 11:30 PM
  4. change all data labels
    By spinkung in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-01-2009, 11:36 AM
  5. [SOLVED] change the column labels from A to Name
    By Confused Deputy in forum Excel General
    Replies: 2
    Last Post: 10-07-2005, 01:05 PM
  6. [SOLVED] How do I Change column labels to ABC from 123 ?
    By Jeff in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-14-2005, 10:07 AM
  7. how do i change a spreadsheet into labels?
    By saveusonthemisssissippi in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-01-2005, 06:06 PM

Tags for this Thread

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