0 / 0 / 0
Регистрация: 16.02.2019
Сообщений: 4
|
|
1 | |
Как упростить код VBA&03.12.2019, 02:41. Показов 598. Ответов 0
Как сократить код? Как записать повторяющийся 3 раза одинаковый кусок кода????
ActiveSheet.ChartObjects.Add(50, 50, 288, 216).Select ActiveChart.ChartWizard Source:=Range(Worksheets(2).Cells(1, 1), Worksheets(2).Cells(A, 2)), Gallery:=xlLineMarkers, Format:=2, PlotBy:=xlColumns, CategoryLabels:=1, SeriesLabels:=0, HasLegend:=False, Title:="????? ??????? ??? ????? v(x)" '??????? ??????? ? ????? ?????????? ActiveChart.Axes(xlCategory).HasTitle = True ActiveChart.Axes(xlCategory).AxisTitle.Characters.Text = "x, ?" ActiveChart.Axes(xlValue).HasTitle = True ActiveChart.Axes(xlValue).AxisTitle.Characters.Text = "v, ?" ActiveChart.Axes(xlValue).Select With Selection.Format.Line .Visible = msoTrue .Weight = 1.25 End With Selection.Format.Line.EndArrowheadStyle = msoArrowheadStealth With Selection.Format.Line .EndArrowheadLength = msoArrowheadLong .EndArrowheadWidth = msoArrowheadWide End With With Selection.Format.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Transparency = 0 End With ActiveChart.PlotArea.Select ActiveChart.Axes(xlCategory).Select With Selection.Format.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 End With With Selection.Format.Line .Visible = msoTrue .Weight = 1.25 End With Selection.Format.Line.EndArrowheadStyle = msoArrowheadStealth With Selection.Format.Line .EndArrowheadLength = msoArrowheadLong .EndArrowheadWidth = msoArrowheadWide End With ActiveChart.Axes(xlCategory).HasMajorGridlines = True ActiveChart.Export Filename:="chart1.gif", FilterName:="gif" UserForm1.img1.Picture = LoadPicture("chart1.gif") ActiveSheet.ChartObjects.Add(50, 50, 288, 216).Select ActiveChart.ChartWizard Source:=Range(Worksheets(2).Cells(1, 3), Worksheets(2).Cells(A, 4)), Gallery:=xlLineMarkers, Format:=2, PlotBy:=xlColumns, CategoryLabels:=1, SeriesLabels:=0, HasLegend:=False, Title:="????? ???? ???????? ??? ????? v1(x)" '??????? ??????? ? ????? ?????????? ActiveChart.Axes(xlCategory).HasTitle = True ActiveChart.Axes(xlCategory).AxisTitle.Characters.Text = "x, ?" ActiveChart.Axes(xlValue).HasTitle = True ActiveChart.Axes(xlValue).AxisTitle.Characters.Text = "v1, ???" ActiveChart.Axes(xlValue).Select With Selection.Format.Line .Visible = msoTrue .Weight = 1.25 End With Selection.Format.Line.EndArrowheadStyle = msoArrowheadStealth With Selection.Format.Line .EndArrowheadLength = msoArrowheadLong .EndArrowheadWidth = msoArrowheadWide End With With Selection.Format.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Transparency = 0 End With ActiveChart.PlotArea.Select ActiveChart.Axes(xlCategory).Select With Selection.Format.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 End With With Selection.Format.Line .Visible = msoTrue .Weight = 1.25 End With Selection.Format.Line.EndArrowheadStyle = msoArrowheadStealth With Selection.Format.Line .EndArrowheadLength = msoArrowheadLong .EndArrowheadWidth = msoArrowheadWide End With ActiveChart.Axes(xlCategory).HasMajorGridlines = True ActiveChart.Export Filename:="chart2.gif", FilterName:="gif" UserForm1.img2.Picture = LoadPicture("chart2.gif") ActiveSheet.ChartObjects.Add(50, 50, 288, 216).Select ActiveChart.ChartWizard Source:=Range(Worksheets(2).Cells(1, 5), Worksheets(2).Cells(A, 6)), Gallery:=xlLineMarkers, Format:=2, PlotBy:=xlColumns, CategoryLabels:=1, SeriesLabels:=0, HasLegend:=False, Title:="????? ??????????? ??????? M0(x)" '??????? ??????? ? ????? ?????????? ActiveChart.Axes(xlCategory).HasTitle = True ActiveChart.Axes(xlCategory).AxisTitle.Characters.Text = "x, ?" ActiveChart.Axes(xlValue).HasTitle = True ActiveChart.Axes(xlValue).AxisTitle.Characters.Text = "M0, ??*?" ActiveChart.Axes(xlValue).Select With Selection.Format.Line .Visible = msoTrue .Weight = 1.25 End With Selection.Format.Line.EndArrowheadStyle = msoArrowheadStealth With Selection.Format.Line .EndArrowheadLength = msoArrowheadLong .EndArrowheadWidth = msoArrowheadWide End With With Selection.Format.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 .Transparency = 0 End With ActiveChart.PlotArea.Select ActiveChart.Axes(xlCategory).Select With Selection.Format.Line .Visible = msoTrue .ForeColor.ObjectThemeColor = msoThemeColorText1 .ForeColor.TintAndShade = 0 .ForeColor.Brightness = 0 End With With Selection.Format.Line .Visible = msoTrue .Weight = 1.25 End With Selection.Format.Line.EndArrowheadStyle = msoArrowheadStealth With Selection.Format.Line .EndArrowheadLength = msoArrowheadLong .EndArrowheadWidth = msoArrowheadWide End With ActiveChart.Axes(xlCategory).HasMajorGridlines = True ActiveChart.Export Filename:="chart3.gif", FilterName:="gif" UserForm1.img3.Picture = LoadPicture("chart3.gif")
0
|
03.12.2019, 02:41 | |
Ответы с готовыми решениями:
0
Нужен драйвера, код PCI\VEN_1039&DEV_7012&SUBSYS_0C98105B&REV_A0\3&B1BFB68&0&17 Код VBA можно упростить или нет? Wpf не виставляются нормально координати елипса && как преобразовать код xaml в код C# Как изменить код чтоб в xml файл записывалось не с > < а с <>? |
03.12.2019, 02:41 | |
03.12.2019, 02:41 | |
Помогаю со студенческими работами здесь
1
Как упростить выражение с ComboBox Vba? query='SELECT * FROM resume WHERE ' & ''' & RecSet('place')& ''' & '=' & '''& s_loc &''' & - что не так? как упростить код Как упростить код? Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |