Solved

Excel Dynamic Cell Selections

Posted on 2000-03-30
1
166 Views
Last Modified: 2010-05-02

How do dynamically select Excel Columns in Visual Basic ? For example if I wanted to place database field names across in individual columns across the first row of a sheet how would I start with cell A1 and reference the next cell B1, C1.. ect.. without using code that looks like (if index = 1 then cell = "A1"... if index = 2 then cell = "A2" ??      
0
Comment
Question by:jeffreyclark
1 Comment
 
LVL 9

Accepted Solution

by:
samopal earned 50 total points
ID: 2670292
You can use this syntax

For i=1 to 10
 For j=1 to 10
   oEx.Cells(i,j).value = i*10+j
 Next
Next

where oEx is Excel object

HTH
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
z = x + y – 1 6 56
Windows 10 start screen issues 9 47
VB6 Compile Compatibility Issue 4 28
Spell Check in VB6 13 43
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now