Scrolling Text VBA Excel

Solved
Manshiz Posted messages 184 Registration date   Status Member Last intervention   -  
Manshiz Posted messages 184 Registration date   Status Member Last intervention   -
Hello,

I have a small issue regarding this code:

Private Sub UserForm_Initialize()
Text = "Loading" & _
" in" & _
" progress," & _
" please" & _
" wait" & _
"..." & _
"" & Space(1)
With Label1
.Caption = Text
End With
End Sub

The text "Loading in progress, please wait..." is almost stuck together when it scrolls,
I would like there to be a gap of empty time in between.
I have done several tests without success. A little help would be welcome.

--
The wise one is the one who wants to learn.
Configuration: Windows 7 Ultimate Acer 1000Go / 4Go Ram Avira Professional Antivirus Firefox 3.6 - Google Chrome

2 answers

  1. Gord21 Posted messages 928 Status Member 289
     
    Good evening,
    I think we need to add spaces (replace Space(1) with Space(10)).
    But I don't think we have the same version of Excel: how do you scroll the text?
    See you later
    --
    Experience: the name by which men name their mistakes.
    Oscar Wilde
    1
  2. Manshiz Posted messages 184 Registration date   Status Member Last intervention   10
     
    Good evening Gord,

    I am working with Office 2007 and here is all the code that we put directly into the UserForm.

    Private Declare Function GetTickCount Lib "Kernel32" () As Long
    Public Stop As Boolean
    Dim Text As String

    Public Sub Timer()
    Dim Top As Long
    Do
    If Stop = True Then Exit Do
    Top = GetTickCount()
    Do While GetTickCount() < Top + 90
    DoEvents
    Loop
    DoEvents
    Message
    DoEvents
    Loop
    End Sub

    Sub Message()
    Dim String1 As String
    Dim String2 As String

    'Scroll a Label in a Frame
    'With LblMessage
    '.Left = .Left - 10
    'If .Left + .Width < 0 Then
    '.Left = Frame1.Width
    'End If
    'End With

    'Scroll text in a Label
    With Label1
    String2 = Left(.Caption, Len(Text) - Len(.Caption) + 1)
    String1 = Right(.Caption, Len(.Caption) - 1) & String2
    .Caption = String1
    End With
    End Sub

    Private Sub UserForm_Activate()
    Timer
    End Sub

    Private Sub UserForm_Click()
    Stop = Not Stop
    End Sub

    Private Sub UserForm_Initialize()
    Text = "Loading" & _
    " in" & _
    " progress," & _
    " please" & _
    " wait" & _
    "..." & _
    "" & Space(1)
    With Label1
    .Caption = Text
    End With
    End Sub

    As I said before, I have already tried, but without result.
    I shortened the text so that the scrolling is smoother;
    by putting the whole phrase in quotes, the words display one by one, it's not nice.

    See you later

    --
    Wise is the one who wants to learn.
    0