• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to create a scrolling text in excel

kishore_lp

New Member
Dear Mr Chandoo,


Please tell me how to create a scrolling text in Excel, like the one we've on TV news channels.

Thanking you
 
Hi kishore_lp,


I just happened to Google and this came up - any use?


http://www.andypope.info/fun/pixilate.htm
 
Andy has another example here

3rd Post

http://www.ozgrid.com/forum/showthread.php?t=41046&highlight=marquee
 
Hi,


Nice concept. I had a little play with some VBA:


Sub Ticker()


Dim VText As String

Dim i As String


VText = Range("C4").Text


ia = 0


Do While ia < 2

i = 0

Do While i < Len(VText)


Range("C5").FormulaR1C1 = Right(VText, Len(VText) - i)


Range("C6").FormulaR1C1 = Left(VText, i)


i = i + 1


Loop


Range("C5") = VText


ia = ia + 1

Loop


End Sub


Where:

ia is the number of full loops

i controls the individual runs


C4 is the Ticker itself formula is "=C5&C6"

C5 is a helper cell removing one from the left each time

C6 is a helper cell adding one to the right


Put your text in C5 and run the macro
 
Hello Experts,


I like the Hui's link more informative,but when Im copying and pasting it in module its throwing me error some like method or datamember not found


on this line i hope:Sheet1.WebBrowser1.Navigate2 ThisWorkbook.Path & "zzxqvk.htm"


Please help me on this what and all measure i need to take to run this kind of macro.


Thanks for support.
 
hello Experts,


Can any one please put some light on my question.


Thank you all for this great support always.


Regards,
 
Hi ,


You are not supposed to copy the code into a module ; if you download the original workbook ( MarqueeTicker.xls ) , you will see that the code is in the Sheet section , in the section pertaining to the sheet where the controls are present.


Also , you have to include the following reference :


Microsoft Internet Controls


Go to the VBE , click on Tools , References , and check the checkbox for the above reference.


Narayan
 
Hi Narayan,


Thanks,but i do the same thing i copied the code and pasted in sheet1 and refrenced the internet controls also but do i need to insert any control also in sheet1 to make this work.i cannot understand the code itself how its working.Please help or do you think is there any other way for scrolling text in excel?


Regards,
 
Hi ,


If you see the MarqueeTicker.xls workbook , it has the following controls on it :


1. A Forms button control captioned Ticker


2. Three Microsoft Web Browser controls ; for this , you have to click on Developer , Insert , More Controls , and from the list select Microsoft Web Browser.


Narayan
 
Hi Narayan,


Sorry to come back again,i implemented the above scrolling word logic and working fine for me but when i upload the file on share point it throws some error for few of my users.Is it because the html tag has to be saved first on the local drive?.


Please let me know how one can open online with scrolling words without throwing error.


Here is the code im using:

Sub scrollcomment()


Dim intUnit As Integer

Dim strTemp As String


strTemp = "<html><head><script language=""javascript"">function noScroll(){document.body.scroll=""no"";}" & _

"</script></head><body onload=javascript:noScroll(); topmargin=""0"" leftmargin=""0"">" & _

"<marquee width=""198"" height=""22"">" & _

"Attention :Targets are based on Region and Commodities only</marquee></body></html>"

intUnit = FreeFile

Open ThisWorkbook.Path & "zzxqvk.htm" For Output As intUnit

Print #intUnit, strTemp

Close intUnit

Sheet1.WebBrowser1.Navigate2 ThisWorkbook.Path & "zzxqvk.htm"

Sheet1.WebBrowser1.Visible = True

End Sub


Thanks,
 
Hi ,


I am sorry I am not in a position to help ; however , if you can give more details about the errors , such as the error messages themselves or the code line which generates the error , it might help.


Narayan
 
Back
Top