Use of number/pound/hash symbol (#)

HelloEh

New Member
Joined
Jan 5, 2010
Messages
8
I've been using the following chunk of VBA code in Excel for a while, and though I understand what each line of code is doing I am not certain I understand some of the syntax.

What is the purpose of the #-symbol in the first line of the Do While...Loop?

I've seen it used this way in other code snippets I've looked at online, but have never seen anyone explain it. I've used it as a double type declaration before (e.g. "dVar = 0#" to assign the double "0.0" to dVar), but don't understand why it might be used that way in this instance.

I've looked for explanations, but it's an awful pain to find anything since search engines exclude the #-symbol and searching for "pound", "number", or "hash" have all sorts of other meanings.

Thanks!

Code:
Sub Read_Input_File
    Dim sFileName As String, sBuf As String
    Dim iFileNum As Integer
    Dim sItems() As String

    sFileName = [Some Valid File Location]

    iFileNum = FreeFile()
    Open sFileName For Input As iFileNum

    Do While Not EOF(iFileNum)
        Line Input #iFileNum, sBuf
        sItems = Split(sBuf, ",")

        [...Do Things with sItems...]
    Loop

    Close iFileNum
End Sub
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top