Solved

Variable declaration in VBA

Posted on 2014-12-10
2
170 Views
Last Modified: 2014-12-10
Is there any meaning for declare the variable appended with % and P in Excel VBA ?

Dim I%, P$          

And what's the following implication :
  P = Range(Cells(I + 1, sLink).Address(RowAbsolute:=False, columnAbsolute:=False))

Tks
0
Comment
Question by:AXISHK
2 Comments
 
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 250 total points
ID: 40493037
The % and $ symbols are shorthand for declaring I as of type Integer and P as of type String:
http://msdn.microsoft.com/en-us/library/s9cz43ek.aspx

I have no idea on the second part of your question.
0
 
LVL 14

Accepted Solution

by:
ThomasMcA2 earned 250 total points
ID: 40493060
For the 2nd part of your question, P will contain the range address of Cells(I + 1, sLink). For example, it could contain $A$1 or $B$2:$C$3.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question