Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default InputBox to resize all charts of active worksheet

Dear Experts:

below code sets a new width for all charts of the active sheet.

The input box functionality should be expanded with the following
features:

- the current width of the first chart is to be displayed as the
default width
- this default width is to be displayed in cm, not in points
- likewise the new width is to be entered in cm, not in points

Your professinal help is more than appreciated. Thank you very much in
advance.

Regards, Andreas


Sub ResizeCharts()

Dim myChtObj As ChartObject
Dim myInput As String

myInput = InputBox(Prompt:="New Width for all charts.", _
Title:="ENTER NEW WIDTH FOR ALL CHARTS", Default:="400")

For Each myChtObj In ActiveSheet.ChartObjects
myChtObj.Width = myInput
Next myChtObj

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default InputBox to resize all charts of active worksheet

Sub ResizeCharts()

Dim myChtObj As ChartObject
Dim myInput As String

'This conversion factor found in net(Not checked with other resources)
Const PoiToCm = 0.035277778

myInput = Application.InputBox(Prompt:="New Width for all charts.", _
Title:="ENTER NEW WIDTH FOR ALL CHARTS",
Default:=ActiveSheet.ChartObjects(1).Width * PoiToCm, Type:=1)

For Each myChtObj In ActiveSheet.ChartObjects
myChtObj.Width = myInput / PoiToCm
Next myChtObj


End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default InputBox to resize all charts of active worksheet

On Aug 9, 10:12*am, Javed wrote:
Sub ResizeCharts()

Dim myChtObj As ChartObject
Dim myInput As String

'This conversion factor found in net(Not checked with other resources)
Const PoiToCm = 0.035277778

myInput = Application.InputBox(Prompt:="New Width for all charts.", _
* * * * * Title:="ENTER NEW WIDTH FOR ALL CHARTS",
Default:=ActiveSheet.ChartObjects(1).Width * PoiToCm, Type:=1)

For Each myChtObj In ActiveSheet.ChartObjects
* * myChtObj.Width = myInput / PoiToCm
Next myChtObj

End Sub


Hi Javed,

great. This works just fine. Thank you very much for your great help.

Regards, Andreas
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
Charts Resize on Open LadyDi Excel Discussion (Misc queries) 0 April 5th 10 07:39 PM
Ho do I resize multiple charts? chairboy Charts and Charting in Excel 12 February 4th 09 07:51 PM
Charts resize themselves WillV Charts and Charting in Excel 0 December 12th 08 03:51 AM
resize charts ayesha Charts and Charting in Excel 0 October 16th 06 02:59 AM
Copy charts and resize Joe34 Excel Programming 0 March 27th 06 04:21 PM


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