本文介绍了在Excel中生成宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在处理一些Excel工作表,其中包含4列,每列具有1000个值.最近,我了解了宏的简单性和快捷性,并希望在我的文件中尝试使用该宏来生成图表.在生成图表的代码中:

Hi all,

I''m working on some excel sheets, that contains 4 columns, each with 1000 values. I recently learnt how simple and quicker macros are and wanted to try that on my file to generate charts. In a code to generate a chart :

Sub CreateChart()
   Range("C3").Select
   Selection.CurrentRegion.Select
   myrange = Selection.Address
   mysheetname = ActiveSheet.Name
   ActiveSheet.ChartObjects.Add(125.25, 60, 301.5, 155.25).Select
   Application.CutCopyMode = False
   ActiveChart.ChartWizard _
     Source:=Sheets(mysheetname).Range(myrange), _
     Gallery:=xlLine, Format:=4, PlotBy:=xlRows, _
     CategoryLabels:=1, SeriesLabels:=1, HasLegend:=1, _
     Title:="", CategoryTitle:="", _
     ValueTitle:="", ExtraTitle:=""

(此代码来自Microsoft支持)
这段代码选择了从A1到D5的所有数据,但是我只想选择一列.我该怎么做?

(This code is taken from the Microsoft support)
this code selects all the data from A1 to D5, but I just want to select one column. How can I do that ?

推荐答案

Range("A:A").Select


这篇关于在Excel中生成宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 09:04
查看更多