excel-2010

How do you disable “Save and send” in Excel 2010 (in the File ribbon (called backstage in Office 2010)?

别等时光非礼了梦想. 提交于 2019-11-28 09:57:14
问题 I have the following VBA marco running in Excel 2003, it blocks the Save, Save as, Save Workspace, Send To menus but I now need to do the same but for Excel 2010 ? Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save As...").Enabled = False Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save").Enabled = False Application.CommandBars("Worksheet Menu Bar").Controls("File").Controls("Save Workspace...").Enabled = False Application.CommandBars(

Find the current user language

你离开我真会死。 提交于 2019-11-28 09:53:13
How can I tell the current user language in a vba program? I need this to show a form in an appropriate language. My initial code (utilising this vbforum code ) assumed that Windows and Excel share a common language - likely but not bulletproof. updated The revised code: Returns the Locale ID (LCID). Looks up the LCID from this msft link . Parses the LCID using a regexp to get the language. Sample output on my machine below The code will let the user know if there are any errors in accessing the LCID website, or in parsing the country name. Sub GetXlLang() Dim lngCode As Long lngCode =

Faster way to hide empty rows

六眼飞鱼酱① 提交于 2019-11-28 08:36:07
问题 I am trying to hide all rows where the value of the cell in Column A is blank (i.e. empty). I was trying to use the following code: Range("A7:A117").SpecialCells(xlCellTypeBlanks).EntireRow.Hidden = True However, every cell in Column A has a VLOOKUP formula and the xlCellTypeBlanks considers a cell with a formula, but no value, not to be blank. So I tried using the following code, but it is extremely slow. For i = 17 To 117 If ActiveSheet.Cells(i, 1) = "" Then ActiveSheet.Cells(i, 1)

Excel 2010 VBA Error 1004 with formula

末鹿安然 提交于 2019-11-28 06:05:52
问题 I have this code: Dim fStrecke As String fStrecke = "=A" & z & "*B" & z & "*C" & z wks.Cells(z, "L").Formula = fStrecke Dim fZeit As String fZeit = "=IF(ISBLANK(H" & z & ");((A" & z & "*B" & z & "*I" & z & ")-I" & z & ")+(A" & z & "*B" & z & "*J" & z & ");(A" & z & "*B" & z & "*H" & z & "))" wks.Cells(z, "K").Formula = fZeit The first formula is working and for the second i get an runtime error 1004. any idea? i have formatted the column K as user defined with "m:ss". 回答1: There are two

Sum Excel Distinct Values

你离开我真会死。 提交于 2019-11-28 05:28:21
问题 I know how to do this with MySQL, but am at a loss as to how (or even if possible) within MS Excel. I am running Excel version 14 on Windows (part of Office Professional 2010). I have a table with two columns...for example one containing phone numbers and the other containing integers (length of phone calls). There are multiple calls from each phone number, so those numbers would likely appear multiple times. I am trying to SUM the total number of minutes per distinct phone number. How can I

Excel 2010: how to use autocomplete in validation list

久未见 提交于 2019-11-28 05:26:57
I'm using a large validation list on which a couple of vlookup() functions depend. This list is getting larger and larger. Is there a way to type the first letters of the list item I'm looking for, instead of manually scrolling down the list searching for the item? I've done some Googling but this suggests that this is indeed possible in earlier versions of Excel, but not in Excel 2010. Hope you guys can help. JMax Here is a very good way to handle this (found on ozgrid ): Let's say your list is on Sheet2 and you wish to use the Validation List with AutoComplete on Sheet1 . On Sheet1 A1 Enter

VBA Autofilter With Multiple Criteria Using Variables

烈酒焚心 提交于 2019-11-28 05:21:40
问题 EDIT: To fix the issue, I changed Dim Placed As Range to As Long . I then changed Set Placed = Rows("3:3").Find("Placed", Range("A3"), searchdirection:=xlToRight) to Placed = Rows("3:3").Find("Placed", Range("A3"), searchdirection:=xlToRight).Column The code works just fine now. END EDIT Ok, I've been working on this issue for almost two hours now. I'm trying to code a couple of option buttons on a worksheet to filter the data as needed. To begin, I recorded myself filtering the data to give

Delete entire row if cell contains the string X

落爺英雄遲暮 提交于 2019-11-28 05:17:24
I am new to VBA and I am trying to come up with a way to delete all rows (and shift cells up, if possible) where the website column cell contains the word none . The table contains 5000+ records and this would save me a great amount of time. I appreciate any suggestions. Many thanks in advance! http://i39.tinypic.com/5ano1d.png This is not a VBA task - This specific task is easiest sollowed with Auto filter. 1.Insert Auto filter (In Excel 2010 click on home-> (Editing) Sort & Filter -> Filter) 2. Filter on the 'Websites' column 3. Mark the 'none' and delete them 4. Clear filter Barry Carter Ok

IF statement: how to leave cell blank if condition is false (“” does not work)

筅森魡賤 提交于 2019-11-28 04:01:49
I would like to write an IF statement, where the cell is left blank if the condition is FALSE. Note that, if the following formula is entered in C1 ( for which the condition is false ) for example: =IF(A1=1,B1,"") and if C1 is tested for being blank or not using =ISBLANK(C1) , this would return FALSE , even if C1 seems to be blank. This means that the =IF(A1=1,B1,"") formula does not technically leave the cells blank if the condition is not met. Any thoughts as to a way of achieving that? Thanks, Portland Runner Try this instead =IF(ISBLANK(C1),TRUE,(TRIM(C1)="")) This will return true for

Substring colouring from Excel VBA: why do some obvious methods not work?

不问归期 提交于 2019-11-28 03:52:43
问题 I've been building some interesting visualizations that rely on VBA code's ability to set different colours for substrings in Excel. For a cell containing a string the syntax works like this rCell.Characters(start,end).Font.Color=SomeColour My application builds the strings and sets the colour values in one step by appending new strings onto the existing values and then setting the colour of the new string. This didn't work. Starting with a complete string and then colouring multiple sub