Solved

Excel Dynamic Cell Selections

Posted on 2000-03-30
1
169 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

830 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