named-ranges

Index Match in VBA for Ranges (finding a loan balance given a loan number and a date)

ぃ、小莉子 提交于 2019-12-12 04:03:55
问题 I was trying to implement the index match combination in VBA to find a number in a range given 2 conditions. The below seems like a great approach, however, my inputs do not come from excel but from a variable that changes in the code itself. For the life of me I can't figure it out but I am a newbie. Excel / VBA - Index Match function using Dynamic Ranges What happens if your name and date instead are a loan number (1,2,3,etc) and date (6/30/2013) and are not in a spreadsheet but are

Copy chart and named range (excel 2010)

别等时光非礼了梦想. 提交于 2019-12-12 03:37:14
问题 I have the following issue with a named range within a chart when copying the tab. Using excel 2010. NAMED RANGE BAND ='TAB1'!$C$32:OFFSET('TAB1'!$C$32,0,COUNTA('TAB1'!$4:$4)-2) Selects only the fields in row 32 of table (in tab 'TAB1') from C32 where there is an entry in row 4. The end result, when working, ensures that there are no blank columns at the end of my chart. I then created a series in my chart using the named range: Series name: ='TAB1'!$B$32 (‘returns the word ‘BAND’) Series

Multiple sheet copying from a working sheet to an archive sheet

爷,独闯天下 提交于 2019-12-12 01:48:32
问题 I have had some help with the last line of this code and it works perfectly for a single sheet in the spreadsheet, however I have 5 sheets in the From spreadsheet and identical 5 sheets in the target spreadsheet how can I get the same range in the other 4 sheets to their same named counterpart in the target sheet? So I used below to try and copy each sheet to its corresponding namesake but I have set up the code as below but only importing the first sheet, also is there a way to only need to

VBA: Filtering a list and storing result as named ranges

不想你离开。 提交于 2019-12-12 00:19:21
问题 I have the following list: I want to make a VBA code filtering the different names on which store they work in, and storing the result in a named range with the name of the store - and the range being the names from the list working in that store. For example, the named ranges would be London - containing cells B2 and B7, and so on. EDIT : I know this is wrong, but I just cannot solve this. VBA is just not what I want it to be at the moment... I first made a new column of the named ranges,

VBA Excel - How to transfer Values of Named Ranges from Workbook B into same/similar Named Ranges in Workbook A?

喜你入骨 提交于 2019-12-11 15:41:52
问题 Thank you in advance for any help. My knowledge is Beginner Level. I can read code but struggle with writing. Also, I assume there is always a better (more efficient) way to write code. The solution is a combination of several objectives: 1. Command button with assigned macro (finished) 2. Error handling (have a little code for this) 3. Identify second Workbook to transfer from (have code for this) 4. Copy & Paste values of 90+ Named Ranges into Workbook A (caveman code using macro recorder)

How to create a table using vba?

一笑奈何 提交于 2019-12-11 10:25:33
问题 I'm writing a simple code to get some key figures from a database import/export. I want to make it user friendly, basically "one buttton click" gives the result. When I wrote the code, I use Alt+F11 and "Play" => it works. But when I inserted the Active X-Control "CommandButton1_Click" the macro stops. Here is where (first line): ActiveSheet.ListObjects.Add(xlSrcRange, Range("A$1:$Be$1500"), , xlYes).Name = _ "Table1" Range("Table1[#All]").Select ActiveSheet.ListObjects("Table1").TableStyle =

Copy Range From One Sheet Paste Part of Range In Same Sheet Based On Cell Value On Another Sheet

﹥>﹥吖頭↗ 提交于 2019-12-11 08:23:13
问题 Right now I've created a code to copy values from one range to another range based on the value from another sheet (the copy and paste happens on one sheet). But because this value can be one of twelve values, the range that is being copied and pasted becomes smaller. Because I'm not adept at VBA I created dozens of copy ranges and dozens of paste ranges in Excel to handle ElseIf statements via VBA to copy and paste depending on what the cell value is in the other sheet. I'm curious, is there

Dynamic ranges again - once more, with text strings

回眸只為那壹抹淺笑 提交于 2019-12-11 01:04:27
问题 I have a series of data sets (later to be used for populating comboboxes), and I've tried setting up dynamic ranges to list only the cells with useful data. In total, there are 160 rows of data, but the number of rows that will be populated will vary wildly. In case it has a bearing on it (if the dynamic ranges detect "" as not blank, for example), the formula used to populate the cells in the range is {=IF(ROW()-ROW(StartPort_NoBlanks)+1>ROWS(StartPort_Blanks)-COUNTBLANK(StartPort_Blanks),""

Run-time error when deleting a named range

痞子三分冷 提交于 2019-12-10 18:16:28
问题 I don't understand why I keep getting a "Run-time error '1004': Application-defined or Object-defined error" message when trying to delete a named range. Here's the code used to import data from a .csv file and name the range as "history" With ActiveSheet.QueryTables.Add(Connection:= _ "TEXT;C:\Users\<user name>\Downloads\history.csv", Destination:=Range(destCell)) .Name = "history" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True

How to join returned values from named range separated by comma

隐身守侯 提交于 2019-12-10 10:16:15
问题 I've spent hours trying to find out how to join returned values from a named range, but the result is a run-time error 32 - Type mismatch. As a newbie I'm still struggling with arrays, so maybe I've overlooked some detail. Thank you for helping me out. Example: (B1)Benzine, (B2)Diesel, (B3)Hybride -> (E1)Gasoline, (E2)Diesel, (E3)Hybrid This is the named range: Another example (to be more clear): Example 2: (B1)Benzine, (B3)Hybride -> (E1)Gasoline, (E3)Hybrid Option Explicit Sub splitter()