+ Reply to Thread
Results 1 to 1 of 1

Forms - macros

  1. #1
    Registered User
    Join Date
    01-24-2013
    Location
    Portugal
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Forms - macros

    Good afternoon,
    My best regards.

    I try to be an autodidact in my life, but when it concerns to VBA has not been easy, therefore,
    I really appreciate the following clarification:
    How would you like to make adjustments to a document (attached file) in Excel that includes a form, I would like to understand the instructions of the macro "Sub Display ()" below.


    Sub Display()
    Dim Cont() As Variant
    Cont = Array(0, 2, 4, 6, 9, 10, 12, 14, 16, 18, 20, 22, 23, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44)
    For X = 1 To 23
    Cadastro.Controls.Item(Cont(X)) = Cells(Pos, X)
    Next X
    Cadastro.Label27.Caption = Pos - 3 & " de " & Total
    End Sub

    ----------------
    Sub Cadastra()
    Application.ScreenUpdating = False
    For Each Control In Cadastro.Controls
    If Left(Control.Name, 4) = "TBox" Then
    Control.Value = ""
    Control.Locked = True
    End If
    Next Control
    Total = 0
    X = 4
    Do Until Cells(X, 1) = ""
    Total = Total + 1
    X = X + 1
    Loop
    Range(Cells(4, 1), Cells(X - 1, 23)).Select
    Selection.Sort Key1:=Range("A4"), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Cadastro.ListBox1.Clear
    Range("A4").Select
    Application.ScreenUpdating = True
    Pos = 4
    Display
    Cadastro.Show
    End Sub

    Best regards,

    Cláudio santos
    Attached Files Attached Files

+ 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