Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Urgent Macro help

Hi All,

Please Need help.

I have a function below that needs to be twicked so that i can use it.

I am trying to apply the second row valuse to the datalables. Can some one
please give me a simpler version of this function so that I can impliment it
and understand as to what is happening so that i can learn from it.

Sub customdatalabels(ActiveChart, columns, measures)
Dim r
Dim c
Dim val
Set rval = False
For r = 1 To r <= measures

For c = 1 To c <= columns
val = Activesheet.Range(col(c) + (r + 1)).Value
If (val < undefined & val < "") Then
rval = True
If (ActiveChart.PlotBy = 2) Then

ActiveChart.SeriesCollection.Item(c).Points.Item(r ).DataLabel.Text = val
Else

ActiveChart.SeriesCollection.Item(r).Points.Item(c ).DataLabel.Text = val
Datasheet.Rows.Item(r + 2).Delete
rval

End Sub

What I understan is that I am looping through the columns and rows and then
going to the send row and getting the valuse for each column and then
appling that to the datalable.


Now I also see that there is reference to col which seems to be an external
function that reads the column names like A, B, C etc...


I was wondering if some one cna give an work around this so that I do not
have to use that external function col and still reference the columns in a
way that i can use them in the function above.


Any and All help will be very much appreciated.

Thanks a bunch folks for being there

Yesh


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Urgent Macro help


Hello Yesh,

It looks like the code is extracting the value of a single cell within
the Range. Change your code to this...

val = Activesheet.Cells(r+ 1, c ).Value

It doesn't need to be reconverted into "A1" format.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=479853

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Urgent Macro help

Sub customdatalabels(ActiveChart, columns, measures)
Dim r
Dim c
Dim val
Set rval = False
For r = 1 To measures

For c = 1 To columns
val = Activesheet.Cells(r+1,c).Value
If (val < undefined & val < "") Then
rval = True
If (ActiveChart.PlotBy = 2) Then

ActiveChart.SeriesCollection.Item(c).Points.Item(r ).DataLabel.Text = val
Else

ActiveChart.SeriesCollection.Item(r).Points.Item(c ).DataLabel.Text = val
Datasheet.Rows.Item(r + 2).Delete
rval

End Sub

--
Regards,
Tom Ogilvy


"Yeshwin" wrote in message
...
Hi All,

Please Need help.

I have a function below that needs to be twicked so that i can use it.

I am trying to apply the second row valuse to the datalables. Can some one
please give me a simpler version of this function so that I can impliment

it
and understand as to what is happening so that i can learn from it.

Sub customdatalabels(ActiveChart, columns, measures)
Dim r
Dim c
Dim val
Set rval = False
For r = 1 To r <= measures

For c = 1 To c <= columns
val = Activesheet.Range(col(c) + (r + 1)).Value
If (val < undefined & val < "") Then
rval = True
If (ActiveChart.PlotBy = 2) Then

ActiveChart.SeriesCollection.Item(c).Points.Item(r ).DataLabel.Text = val
Else

ActiveChart.SeriesCollection.Item(r).Points.Item(c ).DataLabel.Text = val
Datasheet.Rows.Item(r + 2).Delete
rval

End Sub

What I understan is that I am looping through the columns and rows and

then
going to the send row and getting the valuse for each column and then
appling that to the datalable.


Now I also see that there is reference to col which seems to be an

external
function that reads the column names like A, B, C etc...


I was wondering if some one cna give an work around this so that I do not
have to use that external function col and still reference the columns in

a
way that i can use them in the function above.


Any and All help will be very much appreciated.

Thanks a bunch folks for being there

Yesh




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
MACRO URGENT HELP OSK Excel Discussion (Misc queries) 2 June 29th 07 09:08 PM
Urgent - Help VBA Macro Jeff Excel Discussion (Misc queries) 8 October 3rd 05 08:25 PM
Macro help urgent urgent Dave Peterson[_3_] Excel Programming 0 September 4th 03 03:59 PM
Macro help urgent urgent chandra Excel Programming 0 September 4th 03 03:50 PM


All times are GMT +1. The time now is 05:10 PM.

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"