Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dave Peterson
 
Posts: n/a
Default

That seems like a nice approach.

But be careful. If I select A1:B10, I have two columns, but only one area.

But if I select A1:A10, then ctrl-click on B1:B10, I have two areas.

So I would think you'd have to watch out for that, too.

wrote:

Here is the solution to the last selected column problem for chart axis labeling
described below.

sColLabel1 = rngDataSource.Areas(1).Cells(1, 1)
sColLabel2 = rngDataSource.Areas(2).Cells(1, 1)
If rngDataSource.Areas(2).Column < rngDataSource.Areas(1).Column Then
sColLabel1 = rngDataSource.Areas(2).Cells(1, 1)
sColLabel2 = rngDataSource.Areas(1).Cells(1, 1)
End If

This code will make sColLabel2 equal to the rightmost column label even if the
rightmost selected column was selected first.

Dennis

wrote:

Thanks Dave!

myRng.Areas(2).Cells(1, 1) is just what I was looking for. I did not know how
to address the first cell in the 2nd selected column. I didn't know that
"Areas" existed.

What I was trying to do is simplify the code for finding the first cell, which
is a column header, in the 2nd selected column.

For the total code the user(that's me) selects any two columns from a worksheet,
clicks on an icon and a xyScatterChart is displayed of those columns with the
axis's labeled with the first cells from each of the two selected columns. I
gave the code for this macro in my previous post on 7/19/05 entitled "Problem
w/Chart Axis Labeling with VBA"

One problem remains. The xyScatterChart always chooses the right most column
selected as it's Y axis no matter whether it was selected first or last. When
the user selects the rightmost column first and then selects a column to the
left of this column the axis labels will be reversed. Is there anyway to tell
which column is furthest to the right? That is the selected column number?

Thanks.

Dennis


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chart -- How to chart 65536 values in 1 series? kilmaley11 About this forum 0 June 8th 05 11:19 AM
Excel should accomodate more number of rows than 65536, to load l. Laxman Charipally Excel Discussion (Misc queries) 1 April 22nd 05 09:41 PM
How can I open a large Excel file with more than 65536 rows? Ted Excel Discussion (Misc queries) 1 January 13th 05 07:47 PM
More than 65536 to new sheet Pav Excel Worksheet Functions 1 January 13th 05 06:46 PM
increasing the number of rows of a worksheet beyond 65536? ibu Excel Discussion (Misc queries) 2 November 26th 04 08:56 AM


All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"