Excel 2007 :: Check If Folder Exists Based On Certain Cell Value
Aug 2, 2013
I'm new to excel and have had a hang up with the MkDir feature. I would like to check if a folder exists based on a certain cell value, and then create the directory if it does not exist. This is what I have so far.
Dim newFile As String
Dim Path As String
newFile = Range("D5").Value & " " & "op" & Range("B200").Value & " " & Format$(Date, "yyyy-mm-dd")
Path = Range("A210").Value
getting a function working within Excel 2010. What I'm trying to do is to first look in a specific directory and loop through each foldername then check to see if the foldername exists in column B of my worksheet. If the foldername exists then check Column E of the same row for a specific value ("assigned") and then make sure column F of the same row has no picture inside the cell. If those three things exist (column B foldername and column E "assigned" and no picture in column F), then add a picture to column F of the same row as the foldername with a hyperlink to a filename of "notes.one" in that specific folder. Then just loop through each foldername in the specific directory until all foldernames have been checked.
I'm trying to sort all .xls files in a folder by modified date. I want most recent at top because then I will be cycling through and using the most recent version of files that have similar names.
The code I have so far is this:
Code: Sub autolink() Dim folderPath As String Dim FileName As String Dim wb As Workbook
But I need something before it sort the folder by the modified (or better creation date) because there are several files with similar names. I know know, I could put a date in the file name and look for that but I don't control the naming of the files.
I have been tasked with doing a work tracker so we can see what work operatives have done between a date range. The processing of the date range is being done in VBA.
The tracking info comes from an external table that is linked into Excel (version 2007). This table is also filtered.
The problem I have is that there are 3 different tasks that the operative can be doing (each has a different time on how long it should take to complete the task, however that is irrelevant for what I need).
This results in multiple entries in the table (min of 1, max of 3) for each operative. There is a seperate column in the table as well which has the total number of each task that they have done.
So for example the table looks similar to this.
Clock No - Task - Sum of task 239 ------- A -------- 5 239 ------- B ------- 10 239 ------- C ------- 15
What I want to be able to do is to get the sum total for the sum of tasks for the operative, so in the above example for operative 239 I want a value of 30
Is there a formula that can do this? (it is a filtered table so the formula needs to count only visible items)
I work for a UK charity and have a list of funders in an Excel 2007 spreadsheet.
One of the columns refers to the date on which a new application for funding can be made to that particular funder.
In many cases new applications for funding can't be made for 1 or more years since the last application - sometimes as many as 5 years later. How to get a cell to refer to the date that it contains.
For example, say I have in cell A1 "The Acme Funding Organisation" and in cell B1 (i.e. the "Reapply when?" column) a date of 01/04/2013 (British date format, i.e. 1 April 2013) then what I want Excel to do is to look at the date in cell B1 and if that date has been reached to highlight the cell red. That way I'll know that the reapply date has been reached & that a new application can be made.
send the sheet to an email address based on the email address in a cell.
The cell populates from a dropdown list a user selects.
The email will be sent to myself, and one authoriser. If a second authoriser is required then the first authoriser will send this on. I'm trying to make this simple, so when a user clicks a 'send' button on the form this happens automatically.
What im needing is something that will duplicate each row based on Column F as shown below... However I also need the duplicate row numbers added to Column G and then the original row deleted... I will try and show you an example of the input/output i would like to achieve: (also the first row can be ignored it will all be headers)
I have two cells, A2 and B2. When I enter a numeric value into B2, I want it only allowed when certain text values are in A2. I.E.: Allow any value in B2, but only if A1 is either "SYDN or "ADEL".
Now using info found in an old post, I can achieve this with a combination of data validation and code: =OR(A2="SYDN",A2="ADEL") for the validation and for the code:
The only problem is I also need to reset B2 if A2 changes to invalid data as a result of some other input to that cell (A2). In other words if B2 is showing "1" already and A2 were to change from "SYDN" to say "LOND", then B2 needs to be cleared. If A2 changed to "ADEL" then it doesn't need to clear but it is ok if it does because it is fine to re-enter "1" into B2 again.
I have attempted to attach a sample worksheet : Xl0000003.xls
I have a spreadsheet which contains 2 drop down pick lists in Field1 and Field2.
Code: FIELD1 | FIELD2 | FIELD3 -------------------------------------------- In Cell A2, I have this set in Data > Data Validation:
Allow: List Source: =CatList
If the user selects a value from the CatList range, then the drop-down options in Field2 are updated accordingly.
In Cell B2, I have this set in Data > Data Validation:
Allow: List Source: =INDIRECT(A2)
The Ranges are as follows:
Code: Cat1 | Cat2 | Cat3 --------------------------------------------- Cheese | Hat | Square Trees | Cat | Circle Bees | Sat | Triangle Knees | Mat | Rectangle Apologies | Bat | Octagon
I'd really like to be able to add a message into FIELD3, which is based on the value in Cat2
e.g. using pseudocode, something like:
If Field2 value = "Apologies" then put this message in Field3: "This requires approval from A" elseif Field2 value = "Triangle" then put this message in Field3: "This requires approval from XYZ" elseif Feidl2 value = "Bat" then put this message in Field3: "This does not require approval"
Basically this is for an access form, and I need to be able to add a feedback message to field3 based on what's in Field2.
I thought about using the INDIRECT option to add messages but I can't see how I'd do it. Maybe VB would do it, but I don't know it well enough.
I am trying to conditionally format rows based on the first cell in each row. I had this working in a previous worksheet and have gone through several examples based on answers in other threads but do not for the life of me know what I am doing wrong. I am using the conditional formating rules on the ribbon menu.
I have a range A3-W100 pre-formatted with generic data and formulae. Column A has no data. I want the text to change color for that row if the cell in column A is populated. The background and text are set to black to appear unpopulated.
When an item number is entered in column A3, the text color in row 3 changes to white. I can get this to work on one row but if I extend it through the range, all rows change. I want them only to change if the respective A cell is populated.
I am using Formula is =A3>"" Format is Yellow, Applies to =$A$3:$V$100 Stop if True is unchecked
I'm sure this will be an easy question, but I've been searching for awhile and can't seem to find an answer. I'm trying to write code in VBA that will check if a directory within c:documents and settings...my documents exists, and then save a file to that directory. The problem is, I'm having trouble finding the my documents directory. Is there some object or property that I could use to find the my documents path? Note that the worksheet that I'll be working with is in a separate directory, and therefore neither activeworkbook.path nor thisworkbook.path would be an option.
[URL]....When I select a name in column B, it populates column C's dropdown with that name's list of units. When I select a unity type in column C, I'd like it to automatically populate column E in the same row with the value associated with that unit. The values associated with a particular unit can be found to the right of the sheet. So if in row 2 I select Blake in column B, then Unit 5 in column C, I'd like column E to be populated with 14.
Edit: using Excel 2007.
I attached stripped down version of the sheet which is small enough to post. None of the things I removed should affect the topic at hand. The full sheet is available at rapidshare.
I have a worksheet that has a number in cell K5 - the number is generated on "file open" code and is custom formatted as "TN"0000. Thus 1 appears as TN0001, 2 as TN0002 and so on. I am trying to save a copy of the workbook based on the this cells contents i.e. TN0001.xls, TN0002.xls etc. but the files are saved as 1.xls or 2.xls. The code I am using is
I'm using Excel 2007. I would prefer to stay away from the scripting side of the house if possible. This is basically a 3 day forcast weather chart. The top is the actual weather data, the bottom portion is a color coded reflection of how the weather affects various things.
This product is created in excel, but will be embedded into a powerpoint. It will be updated daily. Here is what I would like. I want the color chart at the bottom to update automatically based on the data I enter above. I have a grasp that I can update the color through conditional formatting, although im not exactly sure what that will look like with all of those cells.
I also figured out that I can insert the letters in those lower cells with something similar to " =IF(C6>90, "T", "") " which would put in a 'T' for Temperature when the temperature got above a certain degree.
I run into a problem when I have multiple factors affecting a single cell. For instance on the example in day 2 of my image. Personnel are affected by Temperate AND UV Index. How would I set up that cell to pull that information from both of those cells and display it accordingly? I would prefer the letters to stay separated by the comma, but I could live without that. The default cell color will be green, with the potential to be yellow or red. I left a few examples of possible situations on day 2 and 3.