excel-2010

Finding question marks in cell string

大憨熊 提交于 2019-12-25 01:35:23
问题 I would like to find out if a string within a cell in Excel 2010 contains any of the following, and then return a '1'. ?dementia ? dementia dementia? dementia ? I've tried some formulas but they don't seem able to get past the use of the wildcard and the string when combined. Would anyone have any pointers or advice? Here is a combination of the suggested answers, and my own work around: 回答1: This is the formula you need: =IF(IFERROR(FIND(A2,$C$3),0)>0,1,0) where A2 is the string that you are

Userform for password input

守給你的承諾、 提交于 2019-12-25 01:18:12
问题 I'm working on an Excel Workbook that uses VBA for data input, since I don't want the application itself to be available to the user if the user does not know the password. I managed to set up the Userform for data input and then a new Userform for the password input. However, I noticed that the password is easily bypassed if the Password Userform is terminated. I tried to make the Userform_Terminate() take the user back to the previous Userform, but it just creates an endless loop. Anyone

Convert date e.g. Jun 05 2016 08:00:00 to dd/mm/yyyy hh:mm:ss

我的梦境 提交于 2019-12-25 01:15:41
问题 Got input such as in the topic title. Trying to figure out how to convert this into UK date and time to be used in calculations. I've looked at some methods on Google such as using text to columns, but I don't think this is what I'm looking for... Thanks! Edit: month is always in abbreviated format. Edit 2: I should mention that I'm in the UK, and it doesn't seem to convert US date automagically. Edit 3: Data: Jun 05 2016 08:00:00 to dd/mm/yyyy hh:mm:ss 回答1: Assuming that your source date is

How to check if cell is formatted as Currency?

谁说我不能喝 提交于 2019-12-24 17:31:10
问题 I am working on a project where it is necessary to check that a large number of cells meet a number of criteria. I have been able to use the code below to check whether a cell contains a value in a numeric format. However, I also need a way to check whether a cell contains a value formatted as US Currency. If Not Application.WorksheetFunction.IsNumber(Range(StringColumn & StringRow).Value) Then MsgBox "Test Failed at " & StringColumn & StringRow Exit Sub Else: MsgBox "Valid format for cell "

VBA ADO Excel 2010

爷,独闯天下 提交于 2019-12-24 17:15:28
问题 Hi I am working in a excel file with 46 pivot tables. The code below changes the connection of each pivot table to a new existing connection. Sub changeConnection() Dim pTable As Variant Dim sheet As Variant Dim workBookName As String workBookName = "filename.xlsm" For Each sheet In Workbooks(workBookName).Worksheets For Each pTable In sheet.PivotTables pTable.changeConnection Workbooks(workBookName ).Connections("connection name") Next pTable Next sheet End Sub I want everything to stay the

Excel Run-time error '91' while executing

佐手、 提交于 2019-12-24 17:12:47
问题 I have an Excel 2010 workbook for financial records. On one worksheet, I have a menu. In this menu, I select a button with an attached macro, which hides the cells which make up the menu and un-hides a transaction input form. This transaction input form contains several values that are of no consequence here. After entering the data you hit the appropriately labeled enter button. Now when I wrote the doc this button worked fine; it went to the records worksheet, inserted a blank row in the

Side-Step Application.MsgBox in VBA (Excel)

微笑、不失礼 提交于 2019-12-24 15:00:17
问题 In order to head off a storm of "comment it out" replies, here is my situation: I have a process is normally run 1 iteration by 1 iteration. A user manually hits a button that calls a macro which, upon completion, pops up a message box that reports the total time length the macro ran for. It's pretty handy for diagnosing issues. This code is locked down and I cannot modify it. I am trying to do this at scale. Because the code in the main spreadsheet and workbook are locked, I have a separate

Excel worksheet_change event

别来无恙 提交于 2019-12-24 14:41:38
问题 I am wondering if you could help me with the worksheet_Change for two different targets. MY code is the following: Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range("A1:A50")) Is Nothing Then Exit Sub Range("A1:A50").Copy ThisWorkbook.Sheets(2).Range("B1") End Sub And it is working, whenever anytjing is updated in column A it is updated and copied in column B(worksheet 2). Now the problem I have is that i want to add another target, B1:B50, and only If that target

use Cube Functions to get filtered dimensions

左心房为你撑大大i 提交于 2019-12-24 14:39:58
问题 How do you get a list of filtered dimentions from a cube function say I had a dimention table of addresses: 1234 Any Street Detroit MI 48229 55588 187th St E Seattle WA 98888 4 Blossum Ave Wescotte AL 66554 How could I get a CUBERANKEDMEMBER list of street addresses with a certain zip? 回答1: You could use =cubeset("powerpivot", "nonempty([City].[Zip].children, [Measure].[Count of City])", "set") and then use =Cuberankmember("powerpivot", set, 1) =Cuberankmember("powerpivot", set, 2) .... where

VBA: Set variable to “Empty” or “Missing”? Handling multiple optional arguments?

时光怂恿深爱的人放手 提交于 2019-12-24 14:19:49
问题 Is it possible, or desirable, to set objects/data to an "Empty" or "Missing" variant? I want to be able to conditionally pass optional arguments to a function. Sometimes I want to use an optional argument, sometimes I don't. In Python, you could easily pass through whichever optional arguments you wanted by using **kwdargs to unpack a dictionary or list into your function arguments. Is there something similar (or a way to hack it in VBA) so you can pass in Empty/Missing optional arguments? In