Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear all,
Currently I have made a macro. the text of the code is as follows: Sub ExcelChart2Word() Dim lm As Single Dim tm As Single Dim w As Single Dim h As Single w = Application.InputBox("What should be the Width of Word chart?", , , , , , , 1) h = Application.InputBox("What should be the Height of Word chart?", , , , , , , 1) If w <= 0 Or h <= 0 Then MsgBox ("Action cancelled") Exit Sub Else End If lm = (11 - w) / 2 tm = (8.5 - h) / 2 ActiveChart.Location Whe=xlLocationAsNewSheet ActiveChart.ChartArea.Select ActiveChart.ChartArea.AutoScaleFont = False With ActiveChart.PageSetup .LeftMargin = Application.InchesToPoints(lm) .RightMargin = Application.InchesToPoints(lm) .TopMargin = Application.InchesToPoints(tm) .BottomMargin = Application.InchesToPoints(tm) End With My query is that can someone help me with a code whereby instead of 2 inputboxes, I can ask the user to input the data on onego e.g. a single userform. I have never used a userform before. Any help would be appreciated. Thanks in advance. Vikesh Jain |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Userform and variable | Excel Discussion (Misc queries) | |||
VBA Variable as userform | Excel Programming | |||
Variable ComboBox on Userform | Excel Programming | |||
userform variable as global | Excel Programming | |||
Passing a value to a variable from Userform | Excel Programming |