Put A Formula In The First Worksheet That Will Compare The Property Numbers
Dec 3, 2008
I have a worksheet with property numbers in colum A and first names in column B. Another worksheet has property numbers in A, first names in B, and last names in C (different order, all mixed up)
I want to put a formula in the first worksheet that will compare the property numbers and when it finds a match put the last name from the second worksheet into the first. Does that make any sense? I have tried vlookup but i'm obviously doing something wrong. example below....
# first last
123 x
124 y
125 z
another sheet looks similar but has info in the "last" column. the numbers between the two sheets are not in the same order so i need to search by number and put the info from the second sheet into the first.
View 3 Replies
ADVERTISEMENT
Dec 11, 2013
I have a spreadsheet with two worksheets (sheet 1 and 2). Sheet 1 has all the current employee data on it e.g. employee number, Forename, Surname, Address, Pay rate, etc. Sheet 2 was last month's employee data in the same format. I want to compare the two worksheets on worksheet 3 and highlight any changes or just put the changes on worksheet 3 (this would be better).
The problem is employees might be on different rows on each worksheet and some employees might not be on one spreadsheet due to staff leaving and starting.
Each staff member has a unique employee number to identify them. So I need a formula that matches the employee number and then looks in the cells in sheet 1 and 2 and if different puts the value in sheet 1 into the cell in sheet 3.
View 2 Replies
View Related
Feb 23, 2012
In VB when I select a worksheet, I can amend the (Name) of the worksheet in the properties window. There is also the .Name property which is the same as the sheet tag name.
I can use the (Name) in vb code to identify the sheet e.g.
ControlSheet.cells(1,1)
without having to define ControlSheet as a worksheet first.
How do I access the (Name) which appears at the top of the list of properties in the properties window.
View 1 Replies
View Related
Oct 16, 2008
work around the sum error?
Runtime Error '1004'
unable to locate the sum property of the worksheetfunction class
Public Function CalcSheet()
Dim NoSales(0 To 11) As Range
Dim DriveOffs(0 To 11) As Range
Dim Voids(0 To 11) As Range
Dim Shortages(0 To 11) As Range
Dim tNoSales As Integer
Dim tDriveOffs As Currency
Dim tVoids As Currency
Dim tShortages As Currency
Dim X As Integer
Dim NSc As Integer
Dim DOc As Integer
Dim VOc As Integer
Dim SHc As Integer
Dim aNoSales As Integer
Dim aDriveOffs As Currency
Dim aVoids As Currency
Dim aShortages As Currency
View 9 Replies
View Related
Sep 30, 2009
I have 2 worksheet.
Worksheet 1 contains raw data.
Worksheet 2 contains 2x variables that I need to 'look up' in Worksheet 1 and tell if they are 'true' or 'false'.
I thought this would be easy, have tried lookup, and count etc and nothing is working.
View 2 Replies
View Related
Jan 6, 2009
I've been using the following code successfully for years. Today I would get the error 1004:Unable to set the visible property of the worksheet class. All my searches came up with someone not realizing they had protected the workbook. As you can see, the first thing I do before trying to set the worksheet visible is to unprotect the workbook. In frustration and on a lark I tried .Sheets("items").Visible = True and it worked. These kind of intermittent errors in Excel VBA are very frustrating. Can anyone tell me what I am doing wrong?
View 6 Replies
View Related
Aug 21, 2012
I was having an issue with my vlookups not working properly so I took out the error handler to try and find out why.
It came up with the error "Run-time error '1004': unable to get the vlookup property of the worksheetfunction class"
Below is my code. How to rectify this?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Dim rng As Range, cell As Range
[Code].....
View 5 Replies
View Related
Sep 10, 2012
I have some code that works just fine until I add another For statement to cycle through a list of part numbers.
The line error is:
Code:
WsStock.Cells(StartRow + Avg, j + 8) = Application.WorksheetFunction.Average(WsStock.Range("H" & StartRow & ":H" & EndRow).SpecialCells(xlCellTypeVisible))
With a message code of "Unable to get the Average property of the WorksheetFunction class".
View 6 Replies
View Related
Jul 3, 2014
I have been working on this small project and I it works to create checkboxes and check what boxes are checked. However, at the end of checking which boxes are checked there is a pop up error message saying Run-Time error '1004': Unable to get the CheckBoxes property of the Worksheet class. These are the lines of code, where is the error?
Sub IsBoxChecked()
Dim titles(200) As String
Dim wks As Worksheet
[Code]....
View 5 Replies
View Related
Mar 24, 2007
I'm trying to find the occurence of a date in a range.
Here is the code I'm using:
Windows(todaydate1).Activate
For Each cell In range(Cells(top73, 3), Cells(bot73, 3))
z3 = DateSerial(Year(cell), Month(cell), Day(cell))
Windows("Cash Flow " & todaydate & " PM.xls").Activate
Sheets("Commitments").Activate
However the code stops right on the q3 line where the match function is located. The problem is that I'm getting a Run Time Error 1004:
"Unable to get the match property of the worksheet function class"
This would lead me to believe that the match function is not working. However, in Excel, it does work. Even when using the cell from the other Workbook, it works.
All the dates which appear to be dates are indeed formatted as dates.
The range is good. I've used the immediate window to verify the address and the values of the other variables in play.
?range(Cells(toprw, 2), Cells(botrw, 2)).Address
$B$26:$B$49
Since the correct workbook and sheet is activated, I'm really at a loss here. Below is what the sheet looks like:
View 9 Replies
View Related
Jan 19, 2009
Here is the code that generates the error:
Set rng = Range("I:I")
LR = ActiveSheet.Cells(Rows.count, "I").End(xlUp).Row + 2
Range("I" & LR).Value = Application.WorksheetFunction.Sum(rng)
Range("I" & LR).NumberFormat = "#,##0"
and from what I've read on google the .SUM(rng) need to be set to a range, but isn't it already a range? I tried plugging in there Range("I:I") for rng and that didn't work either.
View 9 Replies
View Related
May 3, 2006
I need to compare two colums by number decription for example m344 in one column and fsh344-1 in another. All I want to match is 344. In column a I want to indcate the match by placing an X by each match. View my attachment for reference. I don't know if it makes a difference but the columns are centered in my original spreadsheet.
View 8 Replies
View Related
Feb 1, 2012
The vlookup worked earlier but now it doesn't and everything looks OK to me. Scroll down a little bit in the code view to see the error line.
HTML Code:
Sub Email_Executed()
Dim OutlookApp As Outlook.Application
Dim MItem As Outlook.MailItem
[Code]...
View 6 Replies
View Related
Feb 16, 2009
I am using the "Find" in VBA and wanted to test if the value searched for could not be found.
So I get the
error = "Unable to get the find property of the worksheet function class"
When the text cannot be found.
Dim zz As Variant
zz = Application.WorksheetFunction.Find("xx", "Hello", 1)
I also tried
Dim xx as boolean
xx = Application.WorksheetFunction.IsError(Application.WorksheetFunction.Find("xx", "Hello", 10))
But this produced the same error.
View 9 Replies
View Related
Dec 26, 2013
I am having problems with some vba codes when I protect my workbook; 'I get an run-time error 1004 Unable to set visible property of the worksheet class'
The code I am trying is:
Sub Stats1_Return_TextBox1_Click()
ActiveSheet.Unprotect "meme"
Application.Goto Worksheets("BCM Database").Range("L15")
Sheets("Stats 1").Visible = False
ActiveSheet.Protect "meme"
End Sub
How to sort this. One more question is there away of protecting you vba code? stop users being able to view or edit them for instance?
View 4 Replies
View Related
Jul 18, 2007
I've noticed error 1004 is very broad and switches its name depending on what you're working with. But I have no idea what it means.
This is the line w/ probs:
Sheeti.Cells(y, 2).Value = WorksheetFunction.DGet(InventoryRange, 3, CriteriaRange)
I looked at protection and Macro security and checked my definitions (that work in other contexts).
Does DGET need to have criteria and database in the same worksheet? My project is working between two workbooks.
View 6 Replies
View Related
Feb 24, 2010
I am getting the following error when i am clicking a Button on sheet1 which is generating duplicate of sheet1.I am trying to delete the button when duplicate is created..Error is:" run-time error '1004' Unable to get the buttons property of the worksheet class" at this line in code"ActiveSheet.Buttons("CmdHistory").Delete"
View 2 Replies
View Related
May 14, 2006
I went through a lot of threads in this forum, although there were a couple relating to the same problem am facing, they didnt solve my error .. so here's my question again ..
When am trying to delink charts , i get an error stating "Unable to set the formula property of series class".
The code is as follows :
Sub DelinkChartData()
Dim iCtr As Integer, iChars As Integer, SH As Shape, iPlotOrder As Integer
Dim nPts As Long, iPts As Long 'Holds the total no of points in the chart
Dim xArray, yArray, sChtName As String, sSrsName As String
Dim xVals, yVals
Dim ChtSeries As Series ' var used to loop thru the series collection
Dim ws As Worksheet
Dim sChartType As String, iCtr1 As Integer
View 9 Replies
View Related
Jul 14, 2006
I am struggling with one problem. I am trying to change formulae of series in a chart using VBA code given below. But I am getting
'Runtime Error 1004, Unable to set the formula property of the series class'
ActiveChart.SeriesCollection(1).Formula = _
Replace(ActiveChart.SeriesCollection(1).Formula, "Sheet1", "test")
View 4 Replies
View Related
Jun 9, 2006
I have a form with several combo boxes, and they function just the way I like as far as being able to pick from the list, or typing in them and having it show you the next available item in the list as you add letters. Whats happening that I would like to know how to deal with is... as soon as you type a letter that is not in my lookup range it generates an error. "Could not get the list property - Invalid property array index". I don't want people to be able to add to the list, but I would like a msgbox to pop up. Then allow them to go back to the box and try again.
View 2 Replies
View Related
Jan 18, 2012
I'm creating a simple bit of code which needs to include an array formula - but the code below fails;
Selection.FormulaArray = _
"=IF($L3="","",IF(ISERROR(INDEX(Data!$BG$7:$BP$11,MATCH('Pay Advice'!$A$2,Data!$A$7:$A$11,0),MATCH(1,IF(Data!$BG$6:$BP$6='Pay Advice'!$L3,IF(Data!$BG$5:$BP$5='Pay Advice'!H$11,1)),0))),0,INDEX(Data!$BG$7:$BP$11,MATCH('Pay Advice'!$A$2,Data!$A$7:$A$11,0),MATCH(1,IF(Data!$BG$6:$BP$6='Pay Advice'!$L3,IF(Data!$BG$5:$BP$5='Pay Advice'!H$11,1))))))"
"Runtime error 1004: Unable to set the FormulaArray property of the range class"
What am I doing wrong? The formula is fine when typed in.
View 7 Replies
View Related
Mar 3, 2014
I'm looking to loop a comparison code. I'm using dynamic referencing (using x and y) to find maximum values for specific time intervals. The code works on a cell to cell basis, meaning if I input the formula and change the cell referencing manually then the equation will give the desired results. However when I attempted to create a VBA code to speed up the process I kept getting a 1004 Unable to set FormulaArray Property of the Range Class error, I later figured out that the Formula Array function is limited to a certain number of characters so I split up my function into 3 different string formulas. I still get the same error.
[Code] ............
View 1 Replies
View Related
Feb 27, 2009
I have two large ranges of numbers stored as text.
I would like to compare first element from first one to each of the second, make a shortlist, and then further analyze the data on shortlist by some additional criteria.
After that the result is written to some place and the cycle continues with the second element from first range etc
Question:
Is it possible (in VBA) to create temporary arrays(baskets) where the fist set of data is analyzed and then after obtaining the result, array(basket) would be emptied and new sets of data is loaded and the cycle goes again?
how the code would look?
View 14 Replies
View Related
Sep 13, 2013
I have two columns that each contain about 100 serial numbers. Most of the serial numbers shoud be in both columns. How to I determine if there is a serial number that is only in one of the columns and not in the other?
View 4 Replies
View Related
Oct 25, 2005
Is there a way to compare two cells to see how many
numbers are same?
For example, A2 contains 16, 17, 19; B2 contains 16, 17; and I want to put
in C2 the result 2.
View 13 Replies
View Related
Jul 6, 2007
I have two numerical columns of different length. One presents the signal and another one the background. Most of the background numbers are found in the signal column but they are not exactly the same and not located in the same rows. The numerical values are the same within some tolerance that I can specify. What I am trying to do it to remove all the background values from the signal column.
View 8 Replies
View Related
Sep 14, 2007
I want to compare 3 columns of data across the same row with an IF statement to verify that all 3 numbers match. I would like the IF statement to only look to the first decimal place, rather than the entire number. In the first example, all columns equal. In the second example all columns equal only to the first decimal place. In either case, all 3 numbers would be equal when rounded down to one decimal place.
Example 1
Column A Column B Column C
84.5 84.5 84.5
Example 2
Column A Column B Column C
84.51 84.53 84.52
View 2 Replies
View Related
May 15, 2008
This is a continuation of a thread that jindon and I had over at the "other" excel site.
OK, where did we leave off.. Oh yeah, It wont get past the:
If rng Is Nothing Then Exit Sub
because it thinks the range is empty.
Set rng = Range("b6:b1103").SpecialCells(2, 2)
View 9 Replies
View Related
Sep 28, 2007
I have an If loop which looks like: If x < 54.5 And x > 52 Then
I have declared x as "Long", but still when it does the comparison it seems to round x up to the nearest whole number for the second comparison ( x > 52 ).
View 4 Replies
View Related
Apr 19, 2007
I seem to be going round and round in circles with this, but I'm sure it should be easy.
I'm just trying to select a range of cells in Sheet2 of my workbook.
I've tried many different bits of code, including:
Dim namesTotal As Integer
namesTotal = 2500
Sheets("Sheet2").Activate
ActiveSheet.Range(Cells(1, 1), Cells(namesTotal, 8)).Select
(According to the Microsoft website, this is supposed to be the way to do it?)
View 10 Replies
View Related