View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Transfering data

I just checked to make sure duplicate invoice numbers where not copied

Sub transferdata()


With Sheets("Main")
RowCount = 5
Start = RowCount
LastRow = .Range("A" & Rows.Count).End(xlUp).Row

Do While RowCount <= LastRow
If .Range("C" & RowCount) < "" Then
Invoice = .Range("C" & RowCount)
End If
If RowCount = LastRow Or _
.Range("B" & (RowCount + 1)) Then

MyMonth = Month(.Range("B" & RowCount))
With Sheets(MyMonth)
Set c = .Columns("C").Find(what:=Invoice, _
LookIn:=xlValues, lookat:=xlWhole)
If c Is Nothing Then
NewRow = .Range("B" & Rows.Count).End(xlUp).Row + 1
Sheets("main").Rows(Start & ":" & RowCount).Copy _
Destination:=.Rows(NewRow)
Start = RowCount + 1
End If
End With
RowCount = RowCount + 1
End If
RowCount = RowCount + 1
Loop
End With


End Sub






"tofimoon4" wrote:


Dear sir,with my regards,like to thank you for your help and wonderful
solution which encouraged me to send another file asking for another
help to transfer datas from main sheet to (12) sheets being the twelve
months (without duplicates the transferred data).
Many thanks in advance.


+-------------------------------------------------------------------+
|Filename: Transferring.zip |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=145|
+-------------------------------------------------------------------+

--
tofimoon4
------------------------------------------------------------------------
tofimoon4's Profile: http://www.thecodecage.com/forumz/member.php?userid=138
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=100128