Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CXomparing Job Numbers
The macro below is meant to go through a cell (Job Number) in A column,
compare it to B1:B17 and if the number doesn't exist, it will transfer the number along with other details to Sheet 3, doesn't work- I'm clearly missing something, I would greatly appreciate someone's help, thanks... Sub mat() For i = 1 To 10 If IsError(match(Cells(i, 1), "b1:b17", 0)) Then Worksheets("Sheet1").Cells(i, 1).EntireRow.Copy Destination:=Worksheets("Sheet3").Cells(i, 1) End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
CXomparing Job Numbers
Hi Teresa,
Try the following adaptation: Sub mat() Dim i As Long Dim j As Long j = 1 With Sheets("Sheet1") For i = 1 To 10 If IsError(Application.Match(.Cells(i, 1), _ .Range("b1:b17"), 0)) Then .Cells(i, 1).EntireRow.Copy _ Destination:=Worksheets("Sheet3").Cells(j, 1) j = j + 1 End If Next End With End Sub --- Regards, Norman "teresa" wrote in message ... The macro below is meant to go through a cell (Job Number) in A column, compare it to B1:B17 and if the number doesn't exist, it will transfer the number along with other details to Sheet 3, doesn't work- I'm clearly missing something, I would greatly appreciate someone's help, thanks... Sub mat() For i = 1 To 10 If IsError(match(Cells(i, 1), "b1:b17", 0)) Then Worksheets("Sheet1").Cells(i, 1).EntireRow.Copy Destination:=Worksheets("Sheet3").Cells(i, 1) End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
CXomparing Job Numbers
Hi Teresa,
Word has caused problems, so here is the code again: Sub mat() Dim i As Long Dim j As Long j = 1 With Sheets("Sheet1") For i = 1 To 10 If IsError(Application.Match(.Cells(i, 1), _ .Range("b1:b17"), 0)) Then .Cells(i, 1).EntireRow.Copy _ Destination:=Worksheets("Sheet3").Cells(j, 1) j = j + 1 End If Next End With End Sub --- Regards, Norman "Norman Jones" wrote in message ... Hi Teresa, Try the following adaptation: Sub mat() Dim i As Long Dim j As Long j = 1 With Sheets("Sheet1") For i = 1 To 10 If IsError(Application.Match(.Cells(i, 1), _ .Range("b1:b17"), 0)) Then .Cells(i, 1).EntireRow.Copy _ Destination:=Worksheets("Sheet3").Cells(j, 1) j = j + 1 End If Next End With End Sub --- Regards, Norman "teresa" wrote in message ... The macro below is meant to go through a cell (Job Number) in A column, compare it to B1:B17 and if the number doesn't exist, it will transfer the number along with other details to Sheet 3, doesn't work- I'm clearly missing something, I would greatly appreciate someone's help, thanks... Sub mat() For i = 1 To 10 If IsError(match(Cells(i, 1), "b1:b17", 0)) Then Worksheets("Sheet1").Cells(i, 1).EntireRow.Copy Destination:=Worksheets("Sheet3").Cells(i, 1) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Decimal Numbers typed into Excel 2003 read as whole numbers | Excel Discussion (Misc queries) | |||
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? | Excel Worksheet Functions | |||
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? | Excel Worksheet Functions | |||
convert negative numbers to positive numbers and vice versa | Excel Worksheet Functions | |||
importing large numbers to vb results in the numbers being formatted to scientific | Excel Programming |