excel-2013

Public vs Private/Dim in Excel VBA

你说的曾经没有我的故事 提交于 2019-12-07 17:47:34
问题 I could use some help in understanding using Public vs Dim in a module in Excel 2013 VBA. First I want to say I did find this great post with excellent definitions (see link below), but no examples and I could use some examples of how I could apply the Public Variables to my project. Also I am a little confused on when I would need to use the Option Private Module; would I need to use that on each module I have or just the module that holds the below code? stackoverflow descriptions

How to reference an old version of the VBA library?

夙愿已清 提交于 2019-12-07 17:35:33
问题 I'm using Excel 2013. The VBA reference is part of Excel (built-in) so I can't remove it. Is it possible to reference another version of the VBA library? The reason I want to know other than curiosity is to look at the object browser of the older versions to see if it lists some currently-hidden/obsolete properties/methods such as Excel.DialogSheet. The Workbook.SheetActivate event has a Sh parameter of type Object. One of the possible sheet types is Excel.DialogSheet which should be checked

Filter all unique items like Google Docs

风流意气都作罢 提交于 2019-12-07 14:45:16
问题 Is there a quick/easy way to filter all unique items in an Excel 2013 column similar to the Google Docs "Unique" function? 回答1: Use the Unique records only feature in Advanced Filter. 回答2: Under the DATA tab there is this: "Remove Duplicates". It'll do what you want. 回答3: There isn't an equivalent to =unique() in Excel, and I hate having to work without it. Without =unique() trying to find all of the unique values in a large array of data is impossible. Take a dozen columns of a hundred+

How to combine subtotal and sumif with a range of criteria

天涯浪子 提交于 2019-12-07 13:34:38
问题 I'm trying to create a formula to combine a SUMIF (using a range of criteria) and a subtotal. The SUMIF statement: =SUMPRODUCT(SUMIF(E:E,O2:O21,G:G)) And where I've gotten on making that SUMIF subtotal: =SUMPRODUCT(SUBTOTAL(9,OFFSET(G2,ROW(G2:G5000)-ROW(G2),0)),(E2:E5000=O2:O21)+0) That last statement returns an #N/A error. I'd appreciate any input y'all can provide. Thank you. Example: Order | Date | Mach | Rem -------|-------|-------|------- A |01/20 | 01 | 1200 B |01/11 | 02 | 400 C |01/21

Using COUNTIFS formulas when linking worksheets

。_饼干妹妹 提交于 2019-12-07 04:56:28
I want to be as detailed as possible. So Let me provide you with the look of my spreadsheet Column H Column Q Row 11 YES Win Row 12 NO Win Row 13 YES Loss ... ... Row 61 YES Win The calculation that I used to give me a count of "Winners" is =COUNTIFS(H11:H61,"YES",Q11:Q61,"Win") and the one for "Losses" is =COUNTIFS(H11:H61,"YES",Q11:Q61,"Loss") - seems to be working well. However, this calculation is on sheet Input. I would like to have this calculation done on a totally different sheet entitled Results. However, my calculation doesn't seem to be working properly. Here is an example of the

Separate octets of IP address using formulas

江枫思渺然 提交于 2019-12-07 01:07:57
问题 I want to separate out the octets of an IP address using Formulas. I have tried some things like substitute & find but cannot figure this out. Example of what I want to achieve, by only starting with Cell A1 and Cell B1 : 10.17.9.192 | 192.168.0.1 10 | 192 17 | 168 9 | 0 192 | 1 回答1: Here are four formulas you need A2:=LEFT(A1,FIND(".",A1)-1) A3:=MID(A1,FIND(".",A1)+1,FIND(".",A1,FIND(".",A1)+1)-FIND(".",A1)-1) A4:=MID(A1,FIND(".",A1,FIND(".",A1)+1)+1,FIND(".",A1,FIND(".",A1,FIND(".",A1)+1)+1

Using VBA to insert and keep images in file - Excel 2013

为君一笑 提交于 2019-12-06 23:55:32
问题 I'm working on a macro for a friend of mine who needs to import a set of images in an excel document and later use this document on other computers. The problem I encountered is that when opening this document on a different computer, all the images are gone and instead you get these little error signs, indicating that the image path could not be found. I have developed the macro on my own computer where I have Excel 2007 and for me, the code works perfectly fine. My friend uses Excel 2013

Use VBA to paste values from one table to another

拥有回忆 提交于 2019-12-06 16:09:05
问题 I have the following VBA code that takes a single row from Sheet Tabled data, copies the data, then pastes the data into the next available row in Sheet Running list. However the original row has formulas and I need the values to paste, not the formulas. I've seen numerous ways to do it with Range.PasteSpecial but this code didn't use Range and I'm not sure how to incorporate it. Note: I modified this code from here: http://msdn.microsoft.com/en-us/library/office/ff837760(v=office.15).aspx.

Excel 2013 VBA Sheets.Add doesn't return new sheet?

老子叫甜甜 提交于 2019-12-06 14:35:24
问题 So my code was working fine, until IT upgraded me to Excel 2013 and the SDI interface. Now it looks like the Sheets.Add function doesn't return the proper worksheet. The template is added to the correct workbook (Template1) but when I use the returned worksheet, it's referencing a sheet from the active workbook, before all the VBA code ran. Public Function Worksheet_AddTemplate(TargetBook As Excel.Workbook, _ TemplateFile as String) As Excel.Worksheet Dim ws As Excel.Worksheet Debug.Print

VBA: Passing multiple values to Instr

允我心安 提交于 2019-12-06 07:21:58
问题 Right now I have a long list of "Industry" values that users have submitted through a form. I've written a macro that will search for particular terms in those values and paste values that conform to my significantly smaller list of "acceptable" Industry values. The point is to reclassify all of the current industry values users have submitted into my existing taxonomy. Here's the way my If-Then statements look as of right now: If InStr(1, Cells(i, "A").Value, "Energy") > 0 Or InStr(1, Cells