I have a macro that creates a new sheet and names it based off a cell value (date, MM-DD-YY), and copies a 'Template' sheet to it, values only. Every so often, two sheets need to be made with the same date. I need the right direction in creating an addition to the below code that will add an A, B, or C at the end of the sheet name if the name is already taken?
I have a large spreadsheet that has thousands of hyperlinks that I would like to check periodically to make sure they are up to date. I have found dozens of examples of VBA code that will do this for me and seemingly very clear instructions on how to do it (for example this), but haven't yet been able to successfully run anything in my spreadsheet. It either doesn't do anything, or I get an error message of a bad file name.
I have a cell in which I would like to have a user enter an email address. If it does not follow a valid format I would like it to display an error message, "Invalid E-mail Address", clear contents and re-select the cell otherwise move to the next cell. By Valid email I want it to check for only one "@", and at least one "." but I also want it so that a user can't just bypass it with typing "@.". I would like it to reject special characters and spaces and only allow "-" and "_" maybe a general format of <name>@<place>.<domain>
The cell in question is K45 and the following cell would be K47 if a valid email is entered
Any way to check if data entered is a valid date using a VBA function/routine?
For example, cdate() and isdate() functions accept dates like 31-Feb-12 and 29-Feb-11 when they are not valid.
If the cell is formatted as date format, then Excel replaces hyphens with forward slashes for dates, except invalid ones like 31-Feb-12 and 29-Feb-11, so in these cases I can test for existence of forward slashes in the following way
want to do something simple, and it just wont paste. not sure why. anyone care to look it over and tell me what i'm doing wrong here?
'Insert Date Information Dim vDate As Date Range("D2").Select ActiveCell.FormulaR1C1 = Date vDate = Date
'Get date from user Dim dDate As Date vDate2 = Application.InputBox(Prompt:="Type in the due date for the location." _ & Chr(13) & Chr(13) & "*If you want the date to default to " & Date + 5 & " then leave the field blank.", _ Title:="Due Date", Type:=1 + 2).............
I need to create a leave tracker wherein i will get the names of the person who want to take leave in that particular month. I have prepared a calendar to make an entry. I need to take care of the following things
1) The person must have sufficient leave balance available to take the leave. so i have to first check if he/she has sufficient leave balance.
2) There are four team leaders and each team has around 13-14 members. so if lots of people from the same team apply for the leave then they will not be eligible for leave. this i want to know in percentage as to how much percentage of people are taking leave from that particular team.
I have a macro right now which makes a selection and then checks that selection to make sure it has less than 5,000 rows. If it has more, then a message box appears and we end the macro. However, in order for this macro to work properly for me, I need to change the if statement so that instead of checking for the amount of rows selected, I only need it to check if ROW 2 is selected. Is this possible? If not, can we have an IF statement to check the contents of ROW 2 (Row 2 is my header on the worksheet and will never change)?
so i have a list of names. the code i have is able to add new sheets to the workbook. but i need the code to be able to run and check all the other worksheets in the workbook to see if that person already has a worksheet. if he/she has a worksheet then End If and go on to the next name.
Sub AddSheetWithNameCheckIfExists() Dim ws As Worksheet Dim newSheetName As String Dim row As Range Dim x As Integer Sheets("data").Select Range("Agent_name").Select ActiveCell.Offset(1, 0).Select Range(ActiveCell, ActiveCell.End(xlDown)).Name = "employees" x = 0 For Each cell In Range("employees") For Each ws In ActiveWorkbook.Worksheets newSheetName = ActiveCell.Offset(x, 0).............
I am trying to create an if statement that would check the results of a drop down menu and return a command to the user to enter certain information.
I created a drop down list, offering a list of projects 'a', 'b' or 'c'. I then created an if statement in the next cell. If user chooses project 'a' then the cell will return the project number associated with the project. The issue I am running into is that if the user chooses project 'c' in the drop down I need the cell to return a command for the user to enter the project name in the cell rather than the cell return the project number. How do I do that?
I have a list of numbers that I have to concatenate with another number depending on if it falls within the parameters and I don't know how to do a lookup on that. I currently am using a complex if/or/and statement which is too dificult to debug and extremely complex like this: if(OR(AND(a>=1,a<=10),AND(a>=20,a<=30)),concatenate(a,"123"),if(OR(AND(a>10,a<20),(a>30,a<40))),conc atenate(a,"456"),"a is not in the parameter")
is there a way to do a lookup for this?
Something else to throw into the mix, there are some ranges that shouldn't be there and return nothing so from 40-55, there shouldn't be a result.
also, there are some that are just one number (56 gets 789 but then at 57 it goes back to abc)
I want to do a check with one cell that has a list of a maximum of 4 numbers seperated by a comma and space, with 4 cells that have one of these numbers in each of them. The numbers wont be in the same order, and they wont be repeated.
Then I have other data which provides a Group ID and a product number, which number is likely to between the Low# and High# in the data list.
What I want is a formula to check whether the product number is between the Low# and the High#, AND that the Group matches.
Example: the data being supplied is Soap 28332. So, I want a formula to check through the data list, and if 28332 is between the Low# and the High# AND if the group SOAP matches, then give back the correct ID number.
Thus for the data Soap 28332, I would want the answer to be 1003, which is the ID # for soap in the given range.
A data listing of Food 73776 should give back the ID 2005, etc, etc. This list of data needing the correct ID# is thousands of lines long.
Thus I need a formula to check that the given number is within the low and high #, and that the group designation matches. If so, then give back the correct ID#.
Column A consists of cells with a variety of five digit numbers. My formula needs to return a text value if numbers are present in column A, this is what I tried: =if(A1="","Chassis") but it returns "False" instead of "Chassis".