I have a program that relies on a remote drive being open and ready. My current tactic (which works perfectly well) is to have a file in the destination drive and ask the date that file was created. If an error occurs I know the destination drive is not ready.
Code:
On Error Resume Next
temp = FileDateTime(destDrive & "xDeletedStuff" & "testFile.txt")
If Err Then
MsgBox "Destination Drive / Folder Not Ready"
Exit Sub
End If
On Error GoTo 0
Idealy I would rather not use the "testFile" I would prefer to just test to see if the folder existed, "destDrive & "xDeletedStuff"
Look at the tab "testing-allproduct" cell C2. If that value exists in the tab name "store-allproduct", cell c2, then take the value from "store-allproduct" cell a2, and put that value into "testing-allproduct cell" A2.
I've currently written the following code to make sure exactly 2 single cell selections are made. But now, I want to extend this code to make sure only cells from rows 5 & 7 are selected and the cells are in the same column.
I have a form that information is entered in. At the end the user can then save the information in a spreadsheet by pressing a command button. The updating to the spreadsheet works, it is the part where the last entry is tested against the info on the form to prevent a duplicate entry that do not work.
I have tested that the program reads the info from the spreadsheet (see the commented lines).
I can attach the whole spreadsheet, but some of the entries on the form are linked to another spreadsheet that make it a bit cumbersome to attach two files.
VB: Private Sub cmdUpdate_Click() Dim lRow As Long Dim ws As Worksheet Set ws = Worksheets("TonnageInput")
I am trying to write an Excel formula to test if there is data in pairs of cells and if there is I want to copy the entire record to another Excel spreadsheet. Example: if there is data in row 1, column A and data in row 1, Column C or row 1 column D, then copy this record to another spreadsheet; if there is data in row 1 column B and data in column C or column, then copy this record to another spreadsheet. Since there is no data in row 4, column C or column D, this row would not be copied. Row 1, row 2, row 3, and row 7 would be copied to another spreadsheet. The data can be numeric or alpha numeric.
I tried using the ISBLANK statement and can't seem to get this to work properly.
I working on a loop that would find blank cell. These cells have a formula in excel, but if certain conditions are met, the cell is left blank. What property in VBA checks for blank cell? I don't thin it's the "empty" property?
Performing hypothesis testing on data comprising of hours devoted to patient care per week for practitioners in conventional and alternative medical practices. I have used data analysis -> z-test-two sample for means to perform my calculations. I would like to know if this is the correct way to perform the hypothesis calculation. See attachment for more details.
Testing For First Letter Of Entry. within an if statement, i'm testing for the first letter of another cell with the function: left(e273,1)= "D". this works well, but i only have a few letters to test for and i'd like to test for not "D", etc. (i.,e, what if the first letter is not D, then do...)...?
I have the following codes to test Caps Lock whether it is on or off. Instead of showing a msgbox when the Caps Lock is on, I there another way to show comment or other object as well as windows UserForms
I have simple data points based on a question that how many people liked product A between 2011 and 2012.
It looks like below
2011 2012 # of Respondents 319 329 % of respondents liking the product 78% 84.5%
The question is: is the increase from 78% to 84.5% statistically significant at either 95% or 99% confidence level. Is it possible to do this basic analysis using Excel?
Basically, looking at the range E6:L19 I need to ensure that any data that is entered into any of these cells ends in either H or W, and if it doesn't flags up a warning message (which I am hoping to link in with the Worksheet_SelectionChange event)
I'm managing it for one cell, but not a whole range.
I have a macro that sorts sets of data that is imported from a LIMS database (SQL). The macro then sorts the data based on a characteristic of the dataset that was pulled in.
I did have the macro working, however now I must add in some AI that groups together certain datasets that don't share the same parameter, as well as discard incomplete datasets, and group together unknown datasets.
In the code following the trouble section, I isolate the required tag, placing it in labelDecoded(2). Now I must test this variable against a couple of cases to see if it is one of the exceptions to the normal rule (which is to Place it in the worksheet named after what is in labelDecoded(2). A switch statement is nessasary as this is still in a prototype/proof of concept phase, and the sorting AI will be expanded in the finished product (As in more cases will be added).
Select Case labelDecoded(2) Case Mid(labelDecoded(2), 1, 1) = "G" getSheetName = Gas Case "DPLS" Or Mid(labelDecoded(2), 1, 2) = "UD" getSheetName = "Other" Case Else getSheetName = labelDecoded(2) End Select
I have highlighted the sections that is giving me an error in red. The first section "Mid(labelDecoded(2), 1, 1) = "G"" Fails to evaluate to true. The Second section "Mid(labelDecoded(2), 1, 2) = "UD"" Throws a type mismatch error, that causes the macro to execute some error handling code, which by co-incidence, is the same as that case evaluating to true.
When a switch statement is called is there an object or variable that holds the information that is being processed by the switch statement? I recognize that my problem is most likely that I am calling the variable that I have allready tested to be tested again.
I'm trying to identify where a set of values 'agree' within a specified tolerance.
I have a list of scores from different sources, and wish to both average them (easy to do) but also to identify how well they 'agree' by flagging those which have a difference above a specified tolerance. The numbers are all integers, and the tolerance will be an integer.
To give an example, I might have cells with values (2,3,2,2) and these agree within a tolerance of 1. If I had cells of (2,4,2,2) these wouldn't agree. I'd like to flag (by the creation of an 'X' within a separate column) where these cells do not agree.
I've done this previously by using chained If and Or statements (e.g. if A1 = D1 or A1 = D1+1 etc etc) but this is laborious and means I have to change logic every time I add a new sample.
Is there a way of specifying a range of cells (e.g. A1,D1,H1, J1) and seeing if the values of these cells agree to within a stated tolerance? I'm happy to define named cells to specify and argument/attribute.
I have set up a linear regression array in Excel and now want to test the significance of my r2 value at a certain level of significance. I've only been able to find tables that give the critical r value, but I want to test it at 99.73% level of confidence and none of them contain that specific value. Is there a way to do this in Excel?
I have an excel template that is used for communicating in projects to teams their responsibilities and defining which stream/group has Accountability/Responsibility/Consulted/Informed (known as a RACI model) for the activity.
For any given project activity, there are rules:
One person is responsible for performing the activity (R) Only one person can be accountable (A) Many people can be consulted through the activity (C) Many people can be informed of progress (I)
You must have an A and and an R for each activity And one person can be accountable AND responsible A/R
Given that project activities can run to 100 + activities in some of our more complex programmes.... I'm looking to provide a flag in the spreadsheet for when an error has occurred and a gap in Responsibility or Accountability is created. (Less worried about testing for C's and I's)
I'm the final stages of testing a userform that, in response to a button click, copies certain cells from a big messy worksheet and pastes the relevant ones (based on user input) in a clean sheet. Suddenly, I started getting a 'divide by zero' error for the following line:
VB : UpCount = PickNum - 6 + ((PickNum / 12))
UpCount and PickNum are both declared as Double, though this shouldn't matter. UpCount is being assigned a value here for the first time, and PickNum varies from 1 to about 250 depending on input.
Obviously I'm only dividing by a constant here, which is VISIBLY not zero. This error only occurs for certain ranges of PickNum...something like 50-70. Interestingly, in trying to debug it, I added:
VB: Msgbox(PickNum) Msgbox(54/12)
...since PickNum was 54 as I was getting this error. Just dividing 54 by 12 ALSO got a div by zero error.
Perhaps I should mention I'm using VBA in Excel 2010 for Mac.
I am running excel 2010. I have set up a variable " testvalue" type variant
I would like the prog to step through a row of data which can contain text or numbers. If any number is greater than 3,000,000 I want exit the do. However, if no number is greater than 3,000,000 I want to record this as a "bad file". I have the follow code which trips at the first "case".
Code: testcol = 1 testrow = myTextRows - 1 'penultimate row Do While Len(wbText.Sheets(1).Cells(testrow, testcol)) > 0 testvalue = wbText.Sheets(1).Cells(testrow, testcol).Value Select Case testvalue
I have two columns, some of the cells in these columns contain more than one value separated by a space. Example:
Col A Col B 1.99 1.69 39.95 6 119.94 29.99 6 149.94 135 250 135.00 250.00 11.6 11.60
What I am trying to achieve is to test that the values in column A match those in column B and have a TRUE/FALSE response in column C. At present i'm just using =a=b, however I want the formula to give me a TRUE response for the third and fourth lines in my example, as I want it to ignore the zero after the decimal place, at present it gives me FALSE.
So the results I want to see in col C for the above example are: FALSE FALSE TRUE TRUE
I am busy writing projects and the macros that I write reference external files (no surprise there). Normally, all referenced files are on the company's main G: drive but recently the company have started the process of re-appraising all access authorities for the folders in the G: drive. This has necessitated that they create a new drive (called J:) and folders and users are being migrated over there as they have been cleaned and approved.
All of this means that some of my users reference J: and some G: and my macros are intermittently falling over because of it. For each user, all the files that they will need will be on either the J: or the G: drive, but not both.
All of the above leads me to ask the following question... How can I build into the macros a "Check what drive you're on and use that letter" line of code
I use the Hyperlink to open PDF files that are on the CD drive from my spreadsheet. I am on Windows XP and the CD drive is the D drive. In Vista the CD drive is the E drive.
When I take the spreadsheet to a Vista machine the link fails as there is no D drive.
Is there any to code the path of the Hyperlink so it will go to th default CD drive for that computer.
We have a form that is completed by our employees and emailed to a central group email address that up to 8 employees within our team can access. When one of our 8 team members open the file sent they need to add comments to it and then save it in a central directory on one of our network drives.
Now the problem I have is that we all have the network drive mapped to a different letter.
Is there a way that I can have a macro (see below for current macro that does not work) save to a network path and not a drive letter.
I have a an excel workbook that is distributed on a flash drive. Currently a Save As Macro copies "A1" as the file name and then opens a screen to allows the user to save that filename to a location that the user selects. What I would like to have happen is for a command button to start a macro that would automatically save the file back to the flash drive that the master workbook is located.
I have part of the code below and need to modify it so that others who only have C: instead of D: to use it
Filename = "D:TempBudgetMonthly.xls"
FileExists = (Dir(Filename) "") If FileExists = False Then msg = "The data file Monthly.xls does not exist !! Load the required file and run the report again !"
If MsgBox(msg, vbExclamation + vbOKCancel) = vbOK Then End If Exit Sub End If
I need code to replace all D: to C: for the entire PROJECT not MODULE.
I am trying to get a excel to list all the file names in a drive along with date last modified, author and file size. I have got the following bit of code to pull back the file names, but i am struggling to find anything that will pull back the other data, I think its something to do with the DIR function, but im not sure........
Range("B1").Select D = ActiveCell Cells(2, 1) = "Filenames" r = 3 f = Dir(D, 7) Do While f "" Cells(r, 1) = f r = r + 1 f = Dir Loop End Sub