Declaring a string question

QuietRiot

Well-known Member
Joined
May 18, 2007
Messages
1,079
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
I noticed today in someone's code they used:

Dim Fund$, FundName$

I'm assuming this delcares a string? What's the difference between that and this?

Dim Fund as String, FundName as string
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
For the benefit of others who don't know these shortcuts (ahem), I'd not use them. The string identifier, of course, is clear enough, but the longs, ints, doubles, bytes, etc. really never stuck in my brain....

Code:
Dim a$, a&, a#, a???

This one is interesting, though:
Date$
Returning a string value for Date rather than a Date serial.
 
Last edited:
Upvote 0
Alexander

I take it you found Date$ either in Help or the every useful ObjectBrowser?

I've also looked through various resources but can't really see the need/point/explanation for doing this.

Unless for it's for use in some other app that requires it in that format.:)
 
Upvote 0
I found it in my "VB & VBA in a nutshell" - my all time favorite VB book. Strangely getting poor reviews on Amazon, too. As if a book that simply has the information you need is not up to snuff! I confess, I've never used a function with $ at the end - but it seems a nice idea.
 
Upvote 0
Yes - I really like my "nutshell" book. Frankly, I love books period. They surround me as if I'd been shipwrecked with them. :)

Alex
 
Upvote 0

Forum statistics

Threads
1,225,410
Messages
6,184,830
Members
453,263
Latest member
LoganAlbright

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