LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro problem. Need a vague not absolute reference

I used do a lot of macros before Visual Basic in Excel. Since th
arrival of the Visual Basic editor I have never had to edit
macro….until now. I just can’t find the name of what I am looking fo
to fix it so I’ll describe what I am doing and maybe somebody can hel
me.
I do a lot of spot charts in Excel. I am a Realtor so I will grap
large sets of data to compare several hundred to several thousand sale
on a scatter chart. I have a way I like to format them that is clea
for others to read that takes about 40 steps so I want to do a macro.
I start with new data each time just setting there selected in
spreadsheet. Before graphing a data set I just select it. It is at tha
point that I would like to start the macro and let it select all of m
preferences and so on.
The problem is that each time I start with a new data set on a ne
spreadsheet and the macro is looking for an absolute reference to th
sheet that I recorded the macro on. Unfortunately the spreadsheet
recorded on is no longer a valid stating place. If I rerun the macr
from the original worksheet everything works great. Once I close tha
sheet and open a new data set I get an error.
It seem that I need to edit the line to not have any reference in it
Kind of the opposite of an absolute reference.

Error is: runtime error 9 – subscript out of range

ActiveChart.SetSourceData Source:=Sheets("BERKLEY").Range("A1:B873")
PlotBy _
:=xlColumns

The above line is copied out of the Visual basic editor.
The source "BERKLEY" was the name of the worksheet I recorded in.
need that to be undetermined.
I like to select the Range before I run the macro and have the macr
just use that range.

If I could change the reference in this line I think this would wor
fine. Thank for any help you might be able to give me.
Jeff Whitbey


--
Message posted from
http://www.ExcelForum.com

 
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
absolute cell reference macro rk0909 Excel Discussion (Misc queries) 4 November 7th 09 12:37 AM
Absolute Reference Problem... Nad Excel Discussion (Misc queries) 5 May 21st 07 06:37 PM
Problem with Absolute reference WakY Excel Discussion (Misc queries) 3 March 28th 07 08:50 PM
Excel too helpful! (problem with absolute reference) PK Excel Worksheet Functions 2 January 25th 06 02:51 PM
Creating an Absolute Reference Macro Renegade Snail Excel Programming 5 March 1st 04 12:47 PM


All times are GMT +1. The time now is 07:44 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"