Determine What Row Data Currently Exists On?
Nov 7, 2012
I have the following data set:
1
Test
2
Testing
3
Test 3
4
Test
Exists on line 1
5
Test 5
6
Test 6
7
Testing
Exists on line 2
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?
View 2 Replies
ADVERTISEMENT
Jul 21, 2009
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).
View 2 Replies
View Related
Mar 17, 2008
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?
View 3 Replies
View Related
Mar 29, 2008
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.
View 3 Replies
View Related
Apr 2, 2008
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).
View 2 Replies
View Related
Feb 14, 2014
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:
A1 B1 C1
0 0.1 TRUE
0.2 0.5 FALSE
0.6 0.8 FALSE
0.9 1.2 TRUE
1.3 1.6 FALSE
1.7 2.0 TRUE
View 7 Replies
View Related
Jan 27, 2008
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.", _ ............
View 2 Replies
View Related
Feb 18, 2008
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?
View 3 Replies
View Related
Mar 29, 2008
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)
View 2 Replies
View Related
Apr 29, 2008
I am attempting an If Or formula and keep retuning a #Value error, I can't for the life of me figure out why.
This is the formula that I have written.
=IF(OR(H44,H45,H46,H47,H48)="Other:","True","False")
Cells H44,I44,J44 have been merged into one cell (H44), and the same for 45,46,47,and 48 - Could this affect the Formula?
View 4 Replies
View Related
Dec 8, 2007
I have 2 sets of data in my excel spreadsheet.
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
View 2 Replies
View Related
Jan 21, 2013
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?
View 8 Replies
View Related
Jun 27, 2012
I have the following within a macro:
Code:
ActiveCell.FormulaR1C1 = "=WEEKDAY(RC[-2],2)"
Range(Selection, Selection.End(xlDown)).Select
Selection.FillDown
Calculate
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).
View 6 Replies
View Related
Mar 10, 2007
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
View 3 Replies
View Related
Nov 14, 2008
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
Range("AE" & date_test + 11).Formula = "='H:BusinessRptTest for scripts[" & date_test & "_CAI_AgentStats.xls]" & date_test & "_CAI_AgentStats'!$D$4"
Else
View 9 Replies
View Related
Jan 14, 2007
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
End Sub
View 9 Replies
View Related
Jun 4, 2006
how do I automatically add beside the name the colum title where it previously existed. see the attached.
View 2 Replies
View Related
Dec 4, 2012
My data looks like this in one sheet:
A
2
B
C
D
1
E
F
3
G
H
I
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:
A
B
A
C
D
E
F
G
F
H
F
A
2
B
C
D
1
E
F
3
G
H
I
View 2 Replies
View Related
Oct 27, 2013
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]
Using excel 2003 on windows 7 64 bit
View 3 Replies
View Related
Mar 4, 2008
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.
14-Feb-08JERRPLCASE671150536:116:56RPLCASE78308147:077:54RPLCASE89431228:228:57RPLCASE910592289:159:59RPLCASE10114732310:0010:48RPLCASE1112146811:4511:58RPLCASE12136563612:0612:56RPLCASE13144122113:0313:58RPLCASE14154642314:0114:23**********--------------TOTALS4632228LDLPKGPIK671361126:046:58PKGPIK781461247:007:56PKGPIK8963598:168:55PKGPIK9101591309:019:59PKGPIK101115113910:0010:54PKGPIK1112968711:3211:59PKGPIK121319916012:0012:59PKGPIK131412310313:0013:59PKGPIK141518716414:0014:59PKGPIK15161119715:0015:54PKGPIK16173316:3016:31**********--------------TOTALS13741178
View 9 Replies
View Related
Dec 28, 2008
I have a situation where i have headers in a file but just because there is a header does not mean there is any corresponding data in that col.
I was keying off if just the header was present then i need to do "something" but now i need to key off two things:
1) Header present
2) If there is anydata in the col when a header is present.
Question: How to use vba to determine (quickly) if there is any data in a given column.
View 4 Replies
View Related
Nov 29, 2006
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
View 8 Replies
View Related
Nov 12, 2013
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.
View 9 Replies
View Related
Aug 21, 2013
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.
View 7 Replies
View Related
Apr 5, 2007
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....
View 9 Replies
View Related
Sep 7, 2009
Given a pivot table, is there any way that I can determine the source data that was used to create the pivot table?
I suspect that the pivot table was created using only part of the data, but I'm not sure.
View 9 Replies
View Related
Dec 2, 2013
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
View 3 Replies
View Related
Jan 28, 2009
I am using the following functions to determine the highest row and column that contain data:
View 4 Replies
View Related
May 7, 2008
I am currently building a workbook with 2 tabs.
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.
View 9 Replies
View Related
Jan 17, 2008
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.
View 2 Replies
View Related