+ Reply to Thread
Results 1 to 12 of 12

Scrolling Text

Hybrid View

  1. #1
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Question Scrolling Text

    Hi there folks!!

    Is it possible to use the marquee scrolling text affect in a cell in excel?

    I want to try and make my sheet a bit slicker and this would look great.

    Thanks for reading and for any advice
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  2. #2
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267
    I have seen it in userforms and xml excel but not a standard worksheet.
    I have no idea were you would even begin to write/find the code for it though.
    JR
    Versions
    Mac OS X 'Leopard'
    Mac MS Office Excel 2004
    Windows XP
    MS Excel 2002
    MS Excel 2003

  3. #3
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Here

    THere was this post a while back but i don;t have internet access to view it!!

    Hi,

    I remember Andy Pope did a replication of a marquee, in a worksheet called pixilate.xls

    http://www.andypope.info/index.htm
    It was posted by Carim

  4. #4
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267

  5. #5
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Talking I can't

    I am unable to access that page you wouldn't screen dump it for me would you?

  6. #6
    Forum Contributor
    Join Date
    09-04-2006
    Location
    Yorkshire, England
    Posts
    267
    heres the code discussed in the post

    Let's suppose the Form is UserForm1.

    Add the following Controls:

    Frame1 to serve as a container for the Label .

    Label1 to display the scrolling Text. This label should be placed within Frame1.Adjust its position as required.

    SpinButton1 to change the Speed of the srolling text.

    One CommandButton:ScrlBttn to activate the scrolling.

    One CommandButton : StpScrlButtn to halt the Scrolling.

    One CommandButton : UnloadFrmBttn to unload the Form.

    Note that ,unlike the other controls, the 3 CommandButtons have their names changed for clarity purposes. Rename them via the Property sheet in the VBE at design time.

    Ok, that's all for the UserForm design.


    Now, let's begin with the Codes and Modules.

    Paste this Code in the UserForm1 Module:



    '  // Code Purpose:
    '===================================
    ' Displays a scrolling text on a UserForm and
    ' add other controls to mange the speed of the
    ' scrolling.
    ' The code uses a Class Module to hook the
    ' ccrpTimer Object to which a reference must
    ' be established Via Tools¦References in the
    ' VB Editor.
    ' The ccrpTimer is part of the High-Performance
    ' Timer Objects which can be downloaded from
    ' www.mvps.org/ccrp/download/ccrpdownloads.htm
    '====================================
    '  // Code written by Jaafar Cobos on 30/06/03.
    
    
    Dim ClssT As Class1
    Dim ccrpTmr As ccrpTimer
        
        
    Private Sub UnloadFrmBttn_Click()
            Unload Me
    End Sub
    
        
    Private Sub SpinButton1_SpinDown()
            Beep
            ScrollSpeed = ScrollSpeed / 2
    End Sub
    
        
    Private Sub SpinButton1_SpinUp()
            Beep
            ScrollSpeed = ScrollSpeed * 2
    End Sub
    
        
    Private Sub UserForm_Initialize()
    
        ScrollSpeed = 1
        msg = "This is a nice scrolling text demonstration !!!"
        
        For i = 1 To 12
            msg = msg & vbCrLf & msg
        Next
        
        Me.Caption = "Scrolling Text Test."
        With Label1
            .Caption = msg
            .Font.Bold = True
            .ForeColor = vbRed
            .Top = Frame1.Height
        End With
        
        With StpScrlButtn
            .Enabled = True
            .Caption = "Stop Label Scrolling"
        End With
        
        With ScrlBttn
            .Enabled = False
            .Caption = "Scroll Label"
        End With
        
        UnloadFrmBttn.Caption = "Unload Form"
        Frame1.Caption = ""
        SpinButton1.Enabled = True
        
        Set ClssT = New Class1
        Set ClssT.ccrpTmr = New ccrpTimer
        ClssT.ccrpTmr.Enabled = True
        ClssT.ccrpTmr.Interval = 10
    
    End Sub
    
    
    Private Sub ScrlBttn_Click()
        ClssT.ccrpTmr.Enabled = True
        SpinButton1.Enabled = True
        ScrlBttn.Enabled = False
        StpScrlButtn.Enabled = True
    End Sub
    
    
    Private Sub StpScrlButtn_Click()
        ClssT.ccrpTmr.Enabled = False
        SpinButton1.Enabled = False
        StpScrlButtn.Enabled = False
        ScrlBttn.Enabled = True
    End Sub
    
    
    
    
    Place this at the top of a Standard Module: 
    
    Public ScrollSpeed As Double
    
    
    
    Insert a Class module Class1 in your project and paste the following code in it: 
    
    
    Public WithEvents ccrpTmr As ccrpTimer
    
    Private Sub ccrpTmr_Timer(ByVal Milliseconds As Long)
    
        With UserForm1
            If .Label1.Top < -.Label1.Height Then
                    .Label1.Top = .Frame1.Height
            End If
            .Label1.Top = .Label1.Top - ScrollSpeed
        End With
    
    End Sub
    or

    Private Sub UserForm_Initialize() 
    Application.OnTime Now + TimeValue("00:00:01"), "ScrollIt" 
    End Sub 
    
    and add this into a module: 
    
    Public Sub ScrollIt() 
    temp = UserForm1.Label1.Caption 
    UserForm1.Label1.Caption = UserForm1.Label2.Caption 
    UserForm1.Label2.Caption = UserForm1.Label3.Caption 
    UserForm1.Label3.Caption = temp 
    Application.OnTime Now + TimeValue("00:00:01"), "ScrollIt" 
    End Sub

    good luck

  7. #7
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Talking Cheers

    Thanks for that i'll give it a try and get back to you, probs 2moro though!!

+ 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