Home

Interpretting a VBA code

%3CLINGO-SUB%20id%3D%22lingo-sub-881278%22%20slang%3D%22en-US%22%3EInterpretting%20a%20VBA%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-881278%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20need%20a%20bit%20help%20with%20the%20very%20first%20statement%20of%20a%20code.%3C%2FP%3E%3CP%3EWe're%20trying%20to%20re-code%20a%20macro%20which%20we've%20been%20using%20for%20a%20while.%20It%20is%20written%20in%2007%20I%20guess%2C%20and%20we%20have%20no%20way%20to%20get%20in%20touch%20with%20that%20person%20who%20wrote%20it.%20So%20I%20just%20have%20to%20read%20the%20code%20line%20by%20line%20%26amp%3B%20then%20try%20to%20re-write%20it%20in%202013.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20first%20line%20is%20as%20follow%2C%3C%2FP%3E%3CP%3EDim%20a%2C%20address1%2C%20z1%2C%20z2%2C%20h1%2C%20h2%2C%20splitaddress%2C%20topaddress%2C%20bottomaddress%20As%20Long%2C%20c%2C%20c1%2C%20pan1%2C%20hh%2C%20zz%2C%20names%2C%20yuer%2C%20jia%2C%20strss.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAccording%20to%20my%20research%20it%20is%20said%20that%20if%20you%20wish%20to%20dim%20more%20than%20one%20variables%20in%20one%20line%2C%20you%20do%20like%20this%20-%20Dim%20a%20as%20Long%2C%20address%20a%20Long%2C%20z1%20as%20long.%3C%2FP%3E%3CP%3EBut%20the%20code%20above%20is%20like%2C%20a%20is%20%22dimed%22%20as%20long%2C%20then%20address%20%22dimed%22%20as%20c%2C%20and%20so%20on.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20be%20honest%2C%20I%20don't%20really%20know%20what%20does%20this%20line%20do%2C%20since%20it%20doesn't%20follow%20the%20rule.%3C%2FP%3E%3CP%3ESo%20my%20question%20is%20-%20is%20the%20code%20above%20legit%2C%20I%20mean%20valid%3F%20If%20yes%2C%20then%20what%20does%20it%20do%3F%20A%20data%20type%20named%20%22c%22%2C%26nbsp%3B%20well%20is%20%22c%22%20a%20same%20kind%20of%20thing%20as%20%22Long%22%2C%20I%20wonder.%3C%2FP%3E%3CP%3EIf%20it%20is%20not%20valid%2C%20then%20I%20assume%20Excel%20will%20skip%20it%20because%20it%20is%20not%20readable%2C%20am%20I%20right%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20taking%20time%20on%20this%2C%3C%2FP%3E%3CP%3EDummy810%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-881278%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-881289%22%20slang%3D%22en-US%22%3ERe%3A%20Interpretting%20a%20VBA%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-881289%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fvisual-basic%2Flanguage-reference%2Fstatements%2Fdim-statement%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fvisual-basic%2Flanguage-reference%2Fstatements%2Fdim-statement%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EPerhaps%20the%20above%20link%20clarifies%20the%20matter.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-882430%22%20slang%3D%22en-US%22%3ERe%3A%20Interpretting%20a%20VBA%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-882430%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20the%20information.%3C%2FP%3E%3CP%3ESo%20far%20I%20might%20conclude%20that%20the%20first%20line%20is%20not%20written%20properly%2C%20yet%20it%20doesn't%20produce%20a%20crash%20in%20the%20program.%20I'll%20see%20how%20it%20goes.%3C%2FP%3E%3C%2FLINGO-BODY%3E
dummy810
Occasional Contributor

Hi guys,

 

Just need a bit help with the very first statement of a code.

We're trying to re-code a macro which we've been using for a while. It is written in 07 I guess, and we have no way to get in touch with that person who wrote it. So I just have to read the code line by line & then try to re-write it in 2013.

 

The first line is as follow,

Dim a, address1, z1, z2, h1, h2, splitaddress, topaddress, bottomaddress As Long, c, c1, pan1, hh, zz, names, yuer, jia, strss.

 

According to my research it is said that if you wish to dim more than one variables in one line, you do like this - Dim a as Long, address a Long, z1 as long.

But the code above is like, a is "dimed" as long, then address "dimed" as c, and so on.

 

To be honest, I don't really know what does this line do, since it doesn't follow the rule.

So my question is - is the code above legit, I mean valid? If yes, then what does it do? A data type named "c",  well is "c" a same kind of thing as "Long", I wonder.

If it is not valid, then I assume Excel will skip it because it is not readable, am I right?

 

Thanks for taking time on this,

Dummy810

2 Replies

@Riny_van_Eekelen 

 

Thanks for the information.

So far I might conclude that the first line is not written properly, yet it doesn't produce a crash in the program. I'll see how it goes.

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
PacketMon Components are not loading in WAC 1909
HotCakeX in Windows Admin Center on
2 Replies