Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 12
Default Problem with VBA code and Range

That did the trick! Thanks so much for the help. I'm using XL2007, but a friend (who still uses XL2003) was trying to help out, which is where the 2003 code might likely have come from.

If I wanted to customize the ChartTitle to the value in column D, would that just be:
..ChartTitle.Characters.Text = "=Sheets(shName).$D$" & i

I tried this, and got "shName$D$1" as the title.

Thanks!

Jeff
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 829
Default Problem with VBA code and Range

"Jeffrey Marks" wrote:
That did the trick! Thanks so much for the help.


Glad to hear it worked well for you.

Jeffrey wrote:
If I wanted to customize the ChartTitle to the value
in column D, would that just be:
.ChartTitle.Characters.Text = "=Sheets(shName).$D$" & i


Try:

..ChartTitle.Characters.Text = Sheets(shName).Range("D" & 2+i)

Remember that "i" is an offset starting at zero. I am guessing that the
title start in D2, just as the data starts in F2:K2.

Better....

Sub OATChartCreate()

Dim i As Integer, shName As String
Dim rowData As Range, rowXAxis As Range
Dim chtTitle as Range '***add***

' *** CUSTOMIZE ***
shName = "OAT Test Charts Dtat_Crosstab"
Set rowData = Sheets(shName).Range("f2:k2")
Set rowXAxis = Sheets(shName).Range("f1:k1")
Set chtTitle = Sheets(shName).Range("d2") '***add***
[....]
.ChartTitle.Characters.Text = chtTitle.Offset(i,0)


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
Problem with VBA code and Range Jeffrey Marks New Users to Excel 1 July 17th 11 11:27 PM
Problem with VBA code and Range Jeffrey Marks New Users to Excel 2 July 17th 11 08:50 AM
Code problem Ruben Excel Discussion (Misc queries) 4 August 26th 08 08:22 AM
Problem with code kk Excel Discussion (Misc queries) 0 March 15th 08 03:01 PM
XLS to CSV Code Problem carl Excel Worksheet Functions 0 March 28th 07 01:21 AM


All times are GMT +1. The time now is 11:29 AM.

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

About Us

"It's about Microsoft Excel"