Sheet One Items Transferred to Sheet Two.
Closed
srigopal
-
3 Mar 2015 à 21:19
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Contributor Last seen 6 September 2024 - 10 Mar 2015 à 02:28
vcoolio Posts 1411 Registration date Thursday 24 July 2014 Status Contributor Last seen 6 September 2024 - 10 Mar 2015 à 02:28
Related:
- Sheet One Items Transferred to Sheet Two.
- How to copy data from one excel sheet to another - Guide
- Little alchemy cheat sheet - Guide
- Outlook duplicate items remover (odir) - Download - Email
- Excel move data from one sheet to another - Guide
- Excel hyperlink to another sheet - Guide
3 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
4 Mar 2015 à 00:38
4 Mar 2015 à 00:38
get list of unique tankers using advanced filter
then autofilter data for each unique tanker number and add worksheet with name as tanker number and paste it there (only filtered data will e pasted)
loop for each unique tanker number
try to do it manually (opening "record macro") and then edit the macro
then autofilter data for each unique tanker number and add worksheet with name as tanker number and paste it there (only filtered data will e pasted)
loop for each unique tanker number
try to do it manually (opening "record macro") and then edit the macro
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Contributor
Last seen
6 September 2024
262
4 Mar 2015 à 01:12
4 Mar 2015 à 01:12
Hello Srigopal,
The following code may do as you ask:-
It transfers all data to each tanker's relevant sheet.
You can have a look at my test work book here:-
https://www.dropbox.com/s/3ctqx2573q10fyz/Srigopal.xlsm?dl=0
to see how it works.
I have moved the "Tanker No." to Column A and the "S. No." to Column B. It just simplified things a little.
The code also clears all data from the "Input" sheet once the transfer of data is complete. This will prevent duplicates in the Tanker sheets but I also assumed that you would not want "used" data cluttering up your "Input" sheet.
I hope that this helps.
Regards,
vcoolio.
The following code may do as you ask:-
Sub TransferData()
Application.ScreenUpdating = False
Dim lRow As Long
Dim ws As Worksheet, ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet, ws4 As Worksheet
Set ws = Worksheets("Input")
Set ws1 = Worksheets("1325")
Set ws2 = Worksheets("4433")
Set ws3 = Worksheets("5555")
Set ws4 = Worksheets("7432")
ws.Select
lRow = Range("A" & Rows.Count).End(xlUp).Row
For Each Cell In Range("A2:A" & lRow)
If Cell = 1325 Then
Cell.EntireRow.Copy ws1.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
ElseIf Cell = 4433 Then
Cell.EntireRow.Copy ws2.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
ElseIf Cell = 5555 Then
Cell.EntireRow.Copy ws3.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
ElseIf Cell = 7432 Then
Cell.EntireRow.Copy ws4.Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
End If
Next Cell
Sheets("Input").Range("A2:F" & Rows.Count).ClearContents
MsgBox "Data transfer completed!", vbExclamation
Application.ScreenUpdating = True
End Sub
It transfers all data to each tanker's relevant sheet.
You can have a look at my test work book here:-
https://www.dropbox.com/s/3ctqx2573q10fyz/Srigopal.xlsm?dl=0
to see how it works.
I have moved the "Tanker No." to Column A and the "S. No." to Column B. It just simplified things a little.
The code also clears all data from the "Input" sheet once the transfer of data is complete. This will prevent duplicates in the Tanker sheets but I also assumed that you would not want "used" data cluttering up your "Input" sheet.
I hope that this helps.
Regards,
vcoolio.
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Contributor
Last seen
6 September 2024
262
4 Mar 2015 à 01:15
4 Mar 2015 à 01:15
Hello Venkat,
My apologies for intruding. We must have posted at the same time!
I'll leave it with you.
Regards,
vcoolio.
My apologies for intruding. We must have posted at the same time!
I'll leave it with you.
Regards,
vcoolio.
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Contributor
Last seen
6 September 2024
262
>
srigopal
4 Mar 2015 à 03:16
4 Mar 2015 à 03:16
Hello Srigopal,
Just delete line 30 from the code and all the data will remain in The "Input" sheet also. But, remember, this will create duplicates in all the Tanker sheets. Do you want the data duplicated?
Regards,
vcoolio.
Just delete line 30 from the code and all the data will remain in The "Input" sheet also. But, remember, this will create duplicates in all the Tanker sheets. Do you want the data duplicated?
Regards,
vcoolio.
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
4 Mar 2015 à 05:37
4 Mar 2015 à 05:37
It is ok. no need for apologies.
vcoolio
Posts
1411
Registration date
Thursday 24 July 2014
Status
Contributor
Last seen
6 September 2024
262
>
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
4 Mar 2015 à 05:41
4 Mar 2015 à 05:41
Cheers my friend.
4 Mar 2015 à 00:51