excel

Generate Column of raw data based on frequency table in Excel

孤街醉人 提交于 2021-02-10 22:29:50
问题 I have a column of numbers and a second column of numbers. The second column of numbers contains the frequency of the numbers in the left column. I want to create a third column of numbers that has the raw data. Example: A B 1 5 3 2 4 4 Column C would look like: C 1 1 1 1 1 3 3 4 4 4 4 How can I do that in Excel? Thanks! 回答1: Based on data in A1:B3 , in C1 , array formula** : =IF(ROWS(A$1:A1)>SUM(B$1:B$3),"",INDEX(A$1:A$3,MATCH(TRUE,MMULT(0+(ROW(A$1:A$3)>=TRANSPOSE(ROW(A$1:A$3))),B$1:B$3)>

Generate Column of raw data based on frequency table in Excel

巧了我就是萌 提交于 2021-02-10 22:28:20
问题 I have a column of numbers and a second column of numbers. The second column of numbers contains the frequency of the numbers in the left column. I want to create a third column of numbers that has the raw data. Example: A B 1 5 3 2 4 4 Column C would look like: C 1 1 1 1 1 3 3 4 4 4 4 How can I do that in Excel? Thanks! 回答1: Based on data in A1:B3 , in C1 , array formula** : =IF(ROWS(A$1:A1)>SUM(B$1:B$3),"",INDEX(A$1:A$3,MATCH(TRUE,MMULT(0+(ROW(A$1:A$3)>=TRANSPOSE(ROW(A$1:A$3))),B$1:B$3)>

Using an array for unique copy from multiple sheets / VBA

久未见 提交于 2021-02-10 22:25:21
问题 I have been working on a macro that summarizes the data from multiple sheets in my workbook. In order to know which columns to use in my summary sheet I need to first extract all the unique values from the first column in my sheets. The idea is that it will loop through the sheets and define a range, then it will loop through each cell in the range, check if the value of that cell is already in the array and if not copy and paste it and add it to the array. Unfortunately I get an the error

Using an array for unique copy from multiple sheets / VBA

梦想与她 提交于 2021-02-10 22:15:48
问题 I have been working on a macro that summarizes the data from multiple sheets in my workbook. In order to know which columns to use in my summary sheet I need to first extract all the unique values from the first column in my sheets. The idea is that it will loop through the sheets and define a range, then it will loop through each cell in the range, check if the value of that cell is already in the array and if not copy and paste it and add it to the array. Unfortunately I get an the error

Xlam Addin how to create update process

ⅰ亾dé卋堺 提交于 2021-02-10 20:44:28
问题 I have created XLAM addin ribbon for user needs. Now I need to create update process for bug fixing purposes. Is it possible to change XLAM file on the fly? 回答1: Yes this is very doable. Two methods to demonstrate: Manual method Make sure the add-in file which is in production is set to read-only (right click file, properties, check the box). When you have finished developing, testing, accepting your update, simply replace the file and ensure you set the new copy back to read-only. Automated

Xlam Addin how to create update process

亡梦爱人 提交于 2021-02-10 20:44:00
问题 I have created XLAM addin ribbon for user needs. Now I need to create update process for bug fixing purposes. Is it possible to change XLAM file on the fly? 回答1: Yes this is very doable. Two methods to demonstrate: Manual method Make sure the add-in file which is in production is set to read-only (right click file, properties, check the box). When you have finished developing, testing, accepting your update, simply replace the file and ensure you set the new copy back to read-only. Automated

Pasting Values Only using VBA: Error "Unable to get the PasteSpecial property of the Range class

≯℡__Kan透↙ 提交于 2021-02-10 20:31:35
问题 I'm trying to get a small macro to work. Basically, all I want to change is making it paste only values. I did not write most of this code, only a few snippets. And it goes like this: Private Sub CommandButton1_Click() Dim LRSrc As Long, LRDest As Long, SrcRng As Range With Sheets("Input sheet") LRSrc = .Cells(.Rows.Count, 1).End(xlUp).Row 'assumes column 1 is contiguous Set SrcRng = .Range("A2:G" & LRSrc) End With If WorksheetFunction.CountA(Range("A2:G2")) = 0 Then Dim emptyErr As Integer

Pasting Values Only using VBA: Error "Unable to get the PasteSpecial property of the Range class

倾然丶 夕夏残阳落幕 提交于 2021-02-10 20:28:38
问题 I'm trying to get a small macro to work. Basically, all I want to change is making it paste only values. I did not write most of this code, only a few snippets. And it goes like this: Private Sub CommandButton1_Click() Dim LRSrc As Long, LRDest As Long, SrcRng As Range With Sheets("Input sheet") LRSrc = .Cells(.Rows.Count, 1).End(xlUp).Row 'assumes column 1 is contiguous Set SrcRng = .Range("A2:G" & LRSrc) End With If WorksheetFunction.CountA(Range("A2:G2")) = 0 Then Dim emptyErr As Integer

VBA Macro to run PowerShell Command

我的梦境 提交于 2021-02-10 18:49:27
问题 I am trying to create a macro, that would be able to rename all files with ".docx" extension in a folder. The PowerShell command works when used directly, but when used through the VBA code, it's not executing. Sub test() Dim retval Dim pscmd pscmd = "PowerShell -ExecutionPolicy Bypass -Command ""Get-ChildItem -Path *.docx -Recurse | Rename-Item -NewName {$_.Name.Substring(0,7) + $_.Extension }""" retval = Shell(pscmd, vbNormalFocus) Debug.Print pscmd End Sub The script is executing without

How to keep the Row Height constant when a table is pushed down on the sheet

这一生的挚爱 提交于 2021-02-10 18:48:06
问题 I have a sheet with 2 tables. Each table has a header that I want to be a height of 30 while all table rows are the standard 15. When I add a row to the top table, the bottom table gets pushed down. The header Height on the bottom table picks up the height of the new spreadsheet row. Is there a way to make the bottom table keep its header height at 30? Here is my code to add rows to the top table. Set tblAssemblies = Worksheets("Summary").ListObjects("Table1") Count = 1 Do tblAssemblies