excel-2016

Excel VBA: How to copy multiple ranges from same sheet

柔情痞子 提交于 2020-08-10 19:33:35
问题 I'm very new to VBA. I have a sheet that has multiple ranges I'd like to copy and paste into news spreadsheets. The first range is C2:I37, and the next begins exactly 36 cells below at C38:I73, and the next one exactly 36 cells below that at C74:I109, and so on. In total, there are 32 ranges that I need to copy, all from the same sheet, and all equal distance apart. I can achieve this for the first range (C2:I37) in the macro given below (it does a few other things that are not relevant to

Excel VBA: How to copy multiple ranges from same sheet

江枫思渺然 提交于 2020-08-10 19:33:13
问题 I'm very new to VBA. I have a sheet that has multiple ranges I'd like to copy and paste into news spreadsheets. The first range is C2:I37, and the next begins exactly 36 cells below at C38:I73, and the next one exactly 36 cells below that at C74:I109, and so on. In total, there are 32 ranges that I need to copy, all from the same sheet, and all equal distance apart. I can achieve this for the first range (C2:I37) in the macro given below (it does a few other things that are not relevant to

Return server error from function as string?

隐身守侯 提交于 2020-07-10 08:44:24
问题 I have an Excel VBA function that takes a URL and returns a response (source: getHTTP with VBA?). response = GetHTTP(.ListColumns(colNameURL).DataBodyRange(n).Value) ... Public Function GetHTTP(ByVal url As String) As String With CreateObject("MSXML2.XMLHTTP") .Open "GET", url, False: .Send GetHTTP = StrConv(.responseBody, vbUnicode) End With End Function The function works as expected. However, if there is a problem with the URL (like the server being down), then the VBA editor pops up an

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:

Counting latest instance of multiple only based on filter context

心已入冬 提交于 2020-02-25 09:49:26
问题 I've got a large table of events that have occurred in an inventory of vehicles, which affect whether they are in service or out of service. I would like to create a measure that would be able to count the number of vehicles in the various inventories at any point in time, based on the events in this table. This table is pulled from a SQL database into an Excel 2016 sheet, and I'm using PowerPivot to try to come up with the DAX measure. Here is some example data event_list : vehicle_id event

Excel: Finding the right match from matrix “scheme”

女生的网名这么多〃 提交于 2020-02-25 06:48:08
问题 I am trying to "match" values or patterns from one sheet to another. I got like "matrix scheme" (the first pic) where I am looking for a certain pattern which is labeled as " _ " and "1". If there is a match ("1"), I should color it in red, or green when no match (" _ "). But that part is easy. As you can see there are 4 "cases" for now, and that is exactly what I want to have on another sheet (the second pic) as match. But I am getting only one match (from Column S ("XC0")) and empty spaces

Excel: Finding the right match from matrix “scheme”

给你一囗甜甜゛ 提交于 2020-02-25 06:46:09
问题 I am trying to "match" values or patterns from one sheet to another. I got like "matrix scheme" (the first pic) where I am looking for a certain pattern which is labeled as " _ " and "1". If there is a match ("1"), I should color it in red, or green when no match (" _ "). But that part is easy. As you can see there are 4 "cases" for now, and that is exactly what I want to have on another sheet (the second pic) as match. But I am getting only one match (from Column S ("XC0")) and empty spaces

PowerQuery COUNTIF Previous Dates

冷暖自知 提交于 2020-01-25 11:27:25
问题 I'm a little rusty on PowerQuery. I need to count "previous" entries in the same table. For example, let's say we have a table of car sales. For the purposes of PowerQuery, this table will be named tblCarSales I need to add two aggregate columns. The first aggregate column is the count of previous sales. The Excel formula would be =COUNTIF([Sale Date],"<"&[@[Sale Date]]) The second aggregate column is the count of previous sales by make . The Excel formula would be =COUNTIFS([Sale Date],"<"&[