So basically I'd like to know if there is a duplicate line item what line item the duplicate actually exists on. Is there an easy way to do this with a formula?
I have a database of 6 digit numbers in one column(let's say column A). I would like to put in a 6 digit number in a cell (b1)and have another cell (c1) give me a response as to whether that number exists in the database (Exists or Doesn't Exist).
I am trying to make a spreadsheet for bank reconiliation. I found this formula, =if( countif($B1:$B$1000,D1),D1)=0,D1,"") but there are two open parathese and three close. What needs to be corrected?
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.
I have programmed an Excel file that removes all the standard commandbars from Excel and then opens a custom commandbar, I built, with limited functionality ( Named "Limited"). When I open this file on another computer, since that custom commandbar does not exist in that copy of Excel no Limited commandbar shows. So I created a macro that builds the custom commandbar when a file is opened. What I want is when the file is opened on subsequent times that it checks to see if that commandbar already exists. If it does, it skips the macro which builds this custom commandbar for the first time. It then disables the standard Excel commandbars (code written already) and enables the "Limited" commandbar (code aleardy written).
I have two columns of data with a minimum value in the first column and a maximum value in the second column. What I'm trying to get is an indicator in a third column which tells me if a whole number falls at or between the minimum and maximum values. Here is a sample of my data:
Before my workbook is open the following code is run, which asks the user to enter the password. Depending on the password Range("name").Value takes values from the worksheet "Data" from table "M4:M20". The list of passwords is in the table "L4:L20". My code seems to be not optimal (too long). Does anybody know how to optimize this code?
Sub GoodMorning() On Error Goto Error 'Prompt the user for a password and unhide the worksheet if correct Select Case InputBox("Please enter the password", _ "Enter Password")
Case Is = "" Call HideSheets MsgBox "Sorry, that password is incorrect! Please contact the administrator.", _ ............
Im trying to write a formula that will check if a name that I have in column A also appears in column B and if it does I want it to return a value for example TRUE in column C.
I'm currently doing a survey and I have all employees in column A (600persons) and then column B I enter thos that have taken the survey. So If an employees name exist in column B he/she has done the survey and then they I get the value "TRUE" or "1" or something else. So in this way I can easily see who has and who hasn't done the survey. I've been trying with VLOOK and so on but I can not get it right? Maybe I need VBA?
I require a row of details to be copied to another worksheet by typing in a unique ID using a macro so Sheet 1 is a data base of items (every item have a unique code like 1001, 1002 etc) and sheet 2 has a table, and next to the table is a cell, which i need to work like a search engine.
i need to be able to type the unique id in a cell, in sheet 2, then click an Add command Button. This button then finds the unique id in sheet 1, and copies all the items details in the same row, into sheet 2 in the table, then i require the search engine to be cleared for the next item to be added. (Assumed Experience:Below Average, I know few formulas and know very basic macros)
Column A has a bunch of numbers and some duplicates Column B has the same numbers but lots more and no duplicates Column C describes what column B number does
All I want is for my formula to return the value in C when A#=b#:b#. The if statement, that I can't figure out how to get it to work right is this. =IF(A2=B2:B1021,C2:C1021)
This is fine if the 1st value is true (meaning a2=b2), the problem is the IF statement returns the 1st value in the array(I think) which in this case is false. An example of the array is below, the result of my formula is always false unless i change B2 to equal A2.
00E200002-Way Mir 00E200012-Way Mir 00E200022-Way Mir 00E200032-Way Mir 00E000E22-Way Mir
I have a worksheet which contains certain sections. I want to create a macro which will run if data is input into those sections. This macro should copy whatever was entered into another worksheet automatically as data is being entered. Is there a way for that?
I want to add to it so that it only fills the formula down as far as there is data in the column to the immediate left. (eg this fills down column C as far as the data goes down in column B).
Right now, when selecting "Sheet2", this macro auto runs, and does it's thing. Is there a way to code it so that upon selecting sheet2, if data exists in the cells, make the macro go to the end of the list? For instance, this macro is great the first time someone goes to sheet2, but if they begin putting data in, and need to go back to sheet1 to reference something, then come back into sheet2, this macro runs again and moves the focus to the cell I coded. I need it to realize that there is now info in the cells, and move not to the selected cell, but to the end of the newly entered data.
Sub Macro3() FinalRow = Cells(65536, 1).End(xlUp).Row If Range("Manual").Value = True Then Sheets("Usage").Activate ActiveWindow.SmallScroll Down:=48 Range("A11").Select Else 'assume Manual is false if it is not true above Sheets("Usage").Activate ActiveWindow.SmallScroll Down:=49 Range("A59").Select End If End Sub
I am using the following VB code to check if a file exists and if so add a formula in my workbook providing data from that file.
I have pre-pulled raw data in the directory "H:BusinessRptTest for scripts" which is named firstly by the day of the month and then what data it is. - i.e/ 13_CAI_AgentStats.xls
The idea of my code is to check firstly whether the file exists (i.e has the data been pulled yet) and then if so to extract the data I need from the correct sheet and if not to add a zero instead.
I thought all was ok, but if the raw workbook is not open I get a #REF error.
I have looked at some posts for getting info from a closed workbook on this site but I can't get my head around incorporating them into my code!
Code listed below
Sub Check_File_Exists()
For date_test = 1 To 31
If Dir("H:BusinessRptTest for scripts" & date_test & "_CAI_AgentStats.xls") "" Then
I have some code that works almost perfectly. I am trying to automatically delete rows in which no data exists in cells in a certain column.
the problem that I am having is that is seems to go into an infinite loop.
For example, if I delete row 5 and then iterate to the next row, row 5 becomes what used to be row 6 and now my code is on row 6...essentially skipping a row.
Here is an example data set (note that the set is for 20 rows): 1 3 6
15
36 37
here is the Sub Macro2()
r = 20 Min = 1 Do While r >= Min If Cells(r, 1) = "" Then Cells(r, 1).EntireRow.Delete Else r = r - 1 End If Loop
Where A is associated with 2 other letters, B and C. D is associated with one other letter, E, and F is associated with 3 other letters. I want an automated way to paste this into 2 columns in a new sheet, like this:
I know how to separate data into different columns i.e. Marry Johnson into two separate columns; however, I have data in different rows that I need separated into different column. See screen cast [URL]
I am trying to create a macro that will look in Column B for the word "RPLCASE." Whenever "RPLCASE" appears in Column B, the cells in that particular row will move over (Right) one space. I am simply trying to align the data from a file that I FTP'd from Net Term to Excel. You can see how the data should look in the 2nd example.
WHEN I FILTER FOR WORDS BEGGINING WITH LETTER I. THERE IS NO DATA...SO I HAVE SOME CODE THAT WILL POP UP MSG BOX. AND IF THERE IS THEN COPY DESIGANTED RANGE..HOWEVEER WHEN I FILTER USING THE BELOW CODE...IT DOES NOT RECOGNIZE THAT THERE IS NOTHING AND JUST GOES THROUGH AS NORMAL..
Sub START() Dim rng As Range Dim rng2 As Range Dim worksheet1 As Worksheet Set worksheet1 = worksheets("MAIN") Selection.AutoFilter Field:=4, Criteria1:="=I*", Operator:=xlAnd With ActiveSheet.AutoFilter.Range On Error Resume Next Set rng2 = .Offset(0, 18).Resize(.Rows.Count - 1, 1) .SpecialCells (xlCellTypeVisible) On Error Goto 0 End With If rng2 Is Nothing Then MsgBox "No data to copy" Else worksheets("noms").Cells.Clear Set rng = ActiveSheet.AutoFilter.Range rng.Offset(1, 0).Resize(rng.Rows.Count - 1).Copy _ destination:=worksheets("NOMS").Range("A1") End Sub
I have a spreadhseet that has rows with headers, blanks & total lines throughout that need to be deleted. There are also about 48 rows of data at the bottom that are not needed.
The row numbers will be variable each time the report is run. I need the macro to find the last row of data in column A, use this as the last row in the range and delete all rows above this unless there is numbers 1 to 12 in column J.
I need to make a fork in my code based on the type of data received from an input box launched from a right click and passed via the actioncontrol parameter.
The input box box is a range selector.
Dim seriesIdArray As Variant seriesIdArray = Range(CommandBars.ActionControl.Parameter)
Generally, the user will have selected multiple cells as their range and I loop through using:
For j = 0 to ubound(seriesIdArray, 2)
However, if they only select one cell, I am getting back the value of that string in seriedIdArray, and that gives me a type mismatch error. I'll need to handle this a little differently, and I know how to do that part, I just don't know when I need to do this.
How can I tell whether they have selected one cell or multiple cells based on the value of the actioncontrol parameter?
I considered trapping the error type (13) and branching based on that, but then I end up with spaghetti code and I'm trying to avoid that.
I think I may need to create another more specific variable to take the action control parameter, test it, and then decide whether I should use an array or a range, but that's just a suspicion.
DETERMINING ROW NUMBER FOR DATA FOUND WITH VLOOKUP IN VBA
I have a user form with a combobox (called STKCODE) that calls up a vlookup routine to search for this item in a named range on a worksheet and retrieve related data to display on the userform. All this works fine.
What I would like to know is how to easily determine the row number on the worksheet, representing the row the data is stored in, if thats at all possible....
Trying to set up a dynamic data validation, where each of the subsequent data validation boxes change based on the selection in the first data validation box (while maintaining 4 parameters within a cell, except for the last one).
I have used the IF-statements to determine the "Week's SUM" in H5.
What I'd like to do next is to determine a formula in the "Week's SUM" cells (H6,H7,H8) based on the choices in data validation boxes "Week #" (G6,G7,G8) with the following rules in place:
1. If I made a choice in G5 to be "1" which caused data validation in cell G6 to update, then in G6 I choose "2", the output in H6 should be just week 2's value of 20 (not the sum of week 1 and 2).
2. However, if I choose "3" in G6 (after I chose "1" in G5, as above) then I'd like the output in H6 to be the SUM of week's 2 AND 3, if that makes sense and so on. (e.g. If I chose "5" in G6, then output in H6 should be the SUM of week's 2 AND 3 AND 4 AND 5).
Same rules apply for H7 and H8. I have a feeling this may involve MATCH function and INDIRECT or SUMIFS but how to approach this.
I've attached a file : Dynamic DV and Dynamic SUMS.xlsx
The first is a data dump tab. The number of rows used in this tab will change each time it is used.
The second tab currently has a header row and in cells A2-H2 are formulas based on data in the first tab.
I am creating a macro to autofill those formulas, but I don't know how to determine what is the last row of data in the 1st tab and use that as reference in my macro.
I have a database that holds thousands of names and the columns are of trinings that they have completed. I can filter by the criteria of name and of ID. ID number is unique so what I want is to know if Column F has a date in it once filtered. It maybe line 789 but that is all it shows because the filter is on.