How to populate data to another tab

Closed
gxxrgx_ Posts 2 Registration date Wednesday July 6, 2016 Status Member Last seen July 6, 2016 - Jul 6, 2016 at 06:53 PM
 RicSan - Jul 8, 2016 at 05:31 AM
Hey there,

If anyone could please spare a moment to help me with this, it would be much appreciated, more than you will know !

What I want to do is this:

I have data on sheet 1, which is separated into columns, Headings are: Property Code, Customer, Document, Agent, Goodman etc in columns A, B, C, D etc respectively.

Agent column is data validated to Yes or No answers only.

Now the rows that have Yes populated, I want to pull the data from that whole row copied onto another tab.

What coding should I go about.

For those that answer, thank you for sparing time.

2 responses

vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Jul 6, 2016 at 07:58 PM
Hello Gxxrgx,

The following code may do the task for you:-


Sub TransferData()

Application.ScreenUpdating = False

        Dim lr As Long
        Dim i As Integer
        
lr = Range("C" & Rows.Count).End(xlUp).Row

For i = lr To 2 Step -1
         If UCase(Cells(i, 3).Value) = UCase("Yes") Then
           Cells(i, 1).EntireRow.Copy
             Sheet2.Range("A" & Rows.Count).End(3)(2).PasteSpecial xlPasteValues
              Cells(i, 1).EntireRow.Delete
       End If
Next

Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub


The code searches the Agent column (Column C) in sheet1 for any "Yes" values and transfers the relevant row of data to sheet2. It then deletes the "used" data from sheet1.

Following is the link to my test work book for you to play with. Click on the "RUN" button to see it work. In the sample, four rows of data should be transferred to sheet2.

https://www.dropbox.com/s/xqdj3n9xqpwpk8e/Gxxrgx%28For%20Next%20loop%20transfer%29.xlsm?dl=0

Let us know if it works for you.

I hope that this helps.

Cheerio,
vcoolio.
0
Hi Good day to you vcoolio. I have a similar problem. but instead of a yes or no, dates are inputted on a column.

Serial Number Machine number Location Date repaired
1234567 0987654 Area 1 May 20 2016

and to make things harder, machines are repaired twice a day or even 3 times. I need to keep track/record of every "Date repaired" on a daily basis. Least of my concern is that this file will be shared by 4 terminals.

It would be a great help if you could solve this problem. I would like to say thank you in advance.

Kind regards
0
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 259
Jul 8, 2016 at 03:21 AM
Hello RicSan,

Could you please start a new thread for your issue. This thread belongs to gxxrgx and hi-jacking a thread is not the correct way to go about solving an issue. Please read the Charter.

If you upload a sample of your workbook (be careful with any sensitive data) to a free file sharing site such as DropBox, ge.tt or SpeedyShare and then post the link to your file in your own thread, then we will be able to see exactly what it is that you would like to do. Please also give a brief as to what you would like to do showing inputs and expected results.

Someone should then be able to assist you.

Cheerio,
vcoolio.
0
Sorry for that vcoolio. Thanks for the reminder.
Also thanks for reading my inquiry.
0