excel-vba

sorting across sheets in excel

冷暖自知 提交于 2020-01-06 16:28:24
问题 I don't know if this is possible or not. I have a workbook that has two sheets, "input" and "output" user1 fills in the "input sheet" Column A = name Column B = Age Column C = Location Column D = Hight .. .. Then on the "output" sheet Column A is set to copy the value from Column A on the "input" sheet and User2 fills in more details using the values that user1 has entered Column B = eye colour Column C = hair colour Column D = number of fingers .. .. So I hope you get the idea, User1 enters

VBA Word Changing table row and column size in

怎甘沉沦 提交于 2020-01-06 16:23:07
问题 nested table in WordI have a template which is essentially a 4-row column in Work. Each cell marked with a bookmark. I've copied a table from Excel to Word into one of these bookmarks (inside on of the cells). Now I'm trying to format this 'nested table' to make it fit according to my desired column widths (for certain columns) but I'm really struggling with the syntax. Additionally, in the table, the first row contains some merged cells (Some are merged to the cell in the adjacent column and

Merge more than 3 Excel worksheets into one workbook with macro

不羁岁月 提交于 2020-01-06 16:22:20
问题 I'm trying to merge worksheets together into one workbook. I have a work book that has over 20 sheets. I was looking to create a macro that would merge sheets together (depending on their name) into a separate workbook. So far this is the code that I have got: it mergers all the sheets in the workbook together but I would like to merge them by name. Sub mergedata() Sheets(1).Activate lastrow = ActiveSheet.UsedRange.Rows.Count For Each Sheet In Sheets If Sheet.Index <> 1 Then RowCount = Sheet

VBA Word Changing table row and column size in

情到浓时终转凉″ 提交于 2020-01-06 16:21:19
问题 nested table in WordI have a template which is essentially a 4-row column in Work. Each cell marked with a bookmark. I've copied a table from Excel to Word into one of these bookmarks (inside on of the cells). Now I'm trying to format this 'nested table' to make it fit according to my desired column widths (for certain columns) but I'm really struggling with the syntax. Additionally, in the table, the first row contains some merged cells (Some are merged to the cell in the adjacent column and

insert values from one sheet into anther

浪子不回头ぞ 提交于 2020-01-06 16:19:18
问题 I have data in one sheet called "Data Storage". I want to display parts of the data in another sheet. The first part of the code finds the data based on input from the user i.e. RPName = Range ("Role Play") The next part identifies a range based on "Role Play" that are a series of numbers that will be averaged. I get an error on this line: Sheets("Data Storage").Range(Cells(RPName_rng1, 5), Cells(RPName_tot, 5)).Name = "Com1avg" I can't figure out why that is causing an error. ' average Macro

insert values from one sheet into anther

痴心易碎 提交于 2020-01-06 16:18:11
问题 I have data in one sheet called "Data Storage". I want to display parts of the data in another sheet. The first part of the code finds the data based on input from the user i.e. RPName = Range ("Role Play") The next part identifies a range based on "Role Play" that are a series of numbers that will be averaged. I get an error on this line: Sheets("Data Storage").Range(Cells(RPName_rng1, 5), Cells(RPName_tot, 5)).Name = "Com1avg" I can't figure out why that is causing an error. ' average Macro

Identifying and highlighting a blank row in Excel VBA

一个人想着一个人 提交于 2020-01-06 16:12:03
问题 Scenario: Each row would contain 23 columns; 20 would contain user populated data and the last 3 would be autogenerated through vba. While running if the vba code identifies the first 20 columns of any row to be blank cells then the whole row is declared blank and highlighted. I have been able to write the following code: For Each rng In Range("A1:A" & LastRow) With rng If .Value < 1 Then MsgBox "Blank Cell found" blnkcnt = 0 For Each mycl In Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row

Identifying and highlighting a blank row in Excel VBA

浪尽此生 提交于 2020-01-06 16:11:09
问题 Scenario: Each row would contain 23 columns; 20 would contain user populated data and the last 3 would be autogenerated through vba. While running if the vba code identifies the first 20 columns of any row to be blank cells then the whole row is declared blank and highlighted. I have been able to write the following code: For Each rng In Range("A1:A" & LastRow) With rng If .Value < 1 Then MsgBox "Blank Cell found" blnkcnt = 0 For Each mycl In Range("A" & ActiveCell.Row & ":T" & ActiveCell.Row

How to properly write and save a new Excel file?

不羁岁月 提交于 2020-01-06 16:03:31
问题 An application (a SCADA program) has an event that trigers every day and run a script that writes an Excel file (one for each day). The file could contain multiple sheets. On Windows 7, with Office 2007 installed, I can write, but I can't save and neither quit the Excel.Application . Dim objExcel as Object Set objExcel = CreateObject("Excel.Application") objExcel.WorkBooks.Add 'I think I shouldn't do this, but if not it doesn't work Set sheet = objExcel.ActiveWorkBook.Worksheets.Add 'writing

How to properly write and save a new Excel file?

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 16:02:54
问题 An application (a SCADA program) has an event that trigers every day and run a script that writes an Excel file (one for each day). The file could contain multiple sheets. On Windows 7, with Office 2007 installed, I can write, but I can't save and neither quit the Excel.Application . Dim objExcel as Object Set objExcel = CreateObject("Excel.Application") objExcel.WorkBooks.Add 'I think I shouldn't do this, but if not it doesn't work Set sheet = objExcel.ActiveWorkBook.Worksheets.Add 'writing