Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
counting columns

ResolvedVersion 2003

Charlene has attended:
Excel VBA Intro Intermediate course

Counting Columns

How would you count up to the last column?

RE: Counting Columns

Hi Charlene

In VBA if you have a range/table of data and need to know the number of columns you do the following:

1. Create a Variable to hold the number of columns value
2. Select a cell in the range
3. Use code to count the columns and save the answer in the variable. For example:

Sub NumberOfColumns()

Dim NumOfColumns As Integer

Sheets(

Mon 15 Dec 2008: Automatically marked as resolved.

Excel tip:

Current date

CTRL+SEMICOLON

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.