Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal Numbers typed into Excel 2003 read as whole numbers john mcmichael Excel Discussion (Misc queries) 1 May 10th 07 08:18 PM
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? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
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? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM
convert negative numbers to positive numbers and vice versa bill gras Excel Worksheet Functions 4 December 7th 05 01:39 AM
importing large numbers to vb results in the numbers being formatted to scientific molly Excel Programming 2 February 3rd 04 02:27 PM


All times are GMT +1. The time now is 07:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"