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: 44
Default Selection.width / .height / .left / .top from cell refor userform

Hi there

I have a macro that makes a chart. I have included in it a userform to try
to control the size & layout of the chart's plot area & legend area. i cant
seem to find a way to make the numbers that come out of the userform
sucessfully change the chart layout, however.

in developing this macro,i have tried several different to set these
parameters. firstly, i tried it with simply the numbers & it works fine;

eg:

----------------------

ActiveChart.Legend.Select
Selection.Height = 34
Selection.Width = 40
Selection.Left = 684
Selection.Top = 196

ActiveChart.PlotArea.Select
Selection.Height = 416
Selection.Width = 673
Selection.Left = 1
Selection.Top = 25

---------------------

fair enough, but i want it to be more dynamic, so i tried this with a cell
ref where each cell equals the numbers above & i get nothing!

eg;

-----------------------------------

ActiveChart.Legend.Select
Selection.Height = Range("A1")
Selection.Width = Range("B1")
Selection.Left = Range("C1")
Selection.Top = Range("D1")

ActiveChart.PlotArea.Select
Selection.Height = Range("E1")
Selection.Width = Range("F1")
Selection.Left = Range("G1")
Selection.Top = Range("H1")

---------------

so then i tried something else, if i name a cell or the spinbutton value or
textbox value from the userform as a range & then quote that it still doesnt
work, though

eg;

--------------------

ActiveChart.Legend.Select
Selection.Height = LegH
Selection.Width = LegW
Selection.Left = LegL
Selection.Top = LegT

ActiveChart.PlotArea.Select
Selection.Height = PloH
Selection.Width = PloW
Selection.Left = PloL
Selection.Top = PloT

-----------------------

this is driving me up the wall!

i cant believe that it will only work if i enter a number rather than
anything else that draws it to the number.

any help gratefully recieved, let me know if you need more info

cheers

jb

 
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
cell 's width and height EXCEL$B!!(BNEWS Excel Programming 1 August 1st 06 10:50 AM
UserForm TextBox with fixed Width and dynamic Height Soniya[_4_] Excel Programming 2 March 4th 06 08:38 AM
cell width and height Brian Brandt New Users to Excel 3 February 14th 06 10:57 AM
What does the 8.43 and 12.75 represent in height and width of cell ljfrantz40 Excel Discussion (Misc queries) 2 October 17th 05 02:25 AM
.AddShape(Type, Left, Top, Width, Height) AA2e72E Excel Programming 2 February 2nd 05 01:56 PM


All times are GMT +1. The time now is 03:15 AM.

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"