excel-vba

Excel Chart has no title error

两盒软妹~` 提交于 2020-05-27 04:14:36
问题 I'm working with VBA trying to make charts. The chart is created like it should, but when I try to define a title, I get this error: "run time error '-2147024809 (80070057): this object has no title." my VBA line is: ActiveChart.ChartTitle.Text = "From " & Cells(Start, Prev) & " To " & Cells(Start, Op) & " - Recomended Setup: 0" Does anyone has any idea why It's not working? (the same line worked on another chart already...) Thank you! 回答1: That is because you need to create the title before

Excel Chart has no title error

别说谁变了你拦得住时间么 提交于 2020-05-27 04:14:33
问题 I'm working with VBA trying to make charts. The chart is created like it should, but when I try to define a title, I get this error: "run time error '-2147024809 (80070057): this object has no title." my VBA line is: ActiveChart.ChartTitle.Text = "From " & Cells(Start, Prev) & " To " & Cells(Start, Op) & " - Recomended Setup: 0" Does anyone has any idea why It's not working? (the same line worked on another chart already...) Thank you! 回答1: That is because you need to create the title before

Piping the output of a Shell Command executed in VBA to a Specific Shell

跟風遠走 提交于 2020-05-26 06:29:10
问题 I am still very very new to VBA and started learning it a couple days ago. Now I am trying to create a Macro to execute a shell command and pipe the output to a specific cell in a specific worksheet. What I am trying to accomplish is to get a text dump of the directory structure into a worksheet. Below is the code i have so far. Sub CopyList() Call Shell("cmd.exe /S /K" & "dir /s /b directoryPath", vbNormalFocus) End Sub Executing this macro brings up a command prompt and dumps the directory

Excel VBA looping through all sheets in all workbooks within a folder

老子叫甜甜 提交于 2020-05-24 05:43:10
问题 I'm using a macro to make changes to all workbooks in a given folder on my computer. The idea is that the changes are made on each sheet of each workbook in the folder. Sequence of events: 1) Opens each Excel file within the user-selected folder 2) Performs a task on each sheet in the workbook 3) Saves the file 4) Closes the workbook However the macro doesn't seem to be working. The problem seems to be arising from Selection.AutoFilter . I am still very new to VBA, so any help or advice would

Produce all combinations from a list of names in excel

老子叫甜甜 提交于 2020-05-24 04:06:01
问题 So I already have the list of permutations, but i'd like to convert it to combinations. So i have a single list of names "john" "mike" "tom", and these have already been converted to two columns of permutations "john mike" "john tom" "mike john" "mike tom" "tom john" "tom mike", so how would i go about either deleting the redundant permutations to convert it to combinations, or would it be easier to make a new macro to just generate combinations? So to be clear, the new list i'm looking for

Produce all combinations from a list of names in excel

試著忘記壹切 提交于 2020-05-24 04:04:27
问题 So I already have the list of permutations, but i'd like to convert it to combinations. So i have a single list of names "john" "mike" "tom", and these have already been converted to two columns of permutations "john mike" "john tom" "mike john" "mike tom" "tom john" "tom mike", so how would i go about either deleting the redundant permutations to convert it to combinations, or would it be easier to make a new macro to just generate combinations? So to be clear, the new list i'm looking for

Location of excel vba macros in xml

浪子不回头ぞ 提交于 2020-05-23 11:16:07
问题 I have a .xlsm format excel (2013) spreadsheet (containing vba macros) that I wish to convert to .xml (to save in a non-proprietary format in a repository, and to provide version control e.g. automated merging of branches in git). As explained here and here, .xlsx files are zipped xml , so they can be converted by simply unzipping. I tried this with a macro-enabled .xlsm file, and I do get an xml structure of the spreadsheet. But I can't find the macros anywhere. Does anyone know where the

How to convert many columns to one column in excel but keep the 1st cell of each column and repeat it in new rows?

醉酒当歌 提交于 2020-05-19 02:48:57
问题 I have and excel document that looks like this: and i want it to be like: *comma (,) means that data are in different cells horizontally. is there any vb macro or an expression to do it? 回答1: If all of the Rows have the same number of columns, then you can use INDEX , INT , COUNTA and MOD to break this down. Column A: =INDEX(Sheet1!$A$1:$D$2,1+INT((ROW()-1)/(COUNTA(Sheet1!$1:$1)-1)),1) Column B: =INDEX(Sheet1!$A$1:$D$2,1+INT((ROW()-1)/(COUNTA(Sheet1!$1:$1)-1)),2+MOD(ROW()-1,COUNTA(Sheet1!$1:

Error with .Offset(1, 0).EntireRow.Delete

时光怂恿深爱的人放手 提交于 2020-05-16 05:00:47
问题 Have read numerous posts on this with various suggestions, can't seem to get past this error. I have a series of code blocks which look for various data in column I of my spreadsheet. If that data is found, then the row should be deleted. I want to do delete all but the header row, and so my blocks of code are as follows (1 example): Sub Strip() With Columns("I") .AutoFilter Field:=1, Criteria1:="=70-79%", VisibleDropDown:=False .Offset(1, 0).EntireRow.Delete .AutoFilter .AutoFilter End With

Error with .Offset(1, 0).EntireRow.Delete

空扰寡人 提交于 2020-05-16 05:00:29
问题 Have read numerous posts on this with various suggestions, can't seem to get past this error. I have a series of code blocks which look for various data in column I of my spreadsheet. If that data is found, then the row should be deleted. I want to do delete all but the header row, and so my blocks of code are as follows (1 example): Sub Strip() With Columns("I") .AutoFilter Field:=1, Criteria1:="=70-79%", VisibleDropDown:=False .Offset(1, 0).EntireRow.Delete .AutoFilter .AutoFilter End With