I require some assistance please. I looked at a few answers on this forum, but I am stuck as my VB keeps on giving errors. I wish to automatically transfer data from one sheet to a specific sheet, but the criteria on the master sheet is that a installation team will be selected from a drop down list. If the specific team has been selected it must transfer the whole line to their individual excel sheet. For example my installation team is in Column G and then there is columns after. The error I am receiving is on the bold line:
Dim i, LastRow
LastRow = Sheets("Diary").Range("A" & Rows.Count).End(xlUp).Row
Sheets("TeamDavid").Range("A2:I5000").ClearContents
For i = 2 To LastRow
If Sheets("Diary").Cells(i, "G").Value = "Team David" Then Sheets("Diary").Cells(i, "G").EntireRow.Copy Destination:=Sheets("TeamDavid").Range("A" & Rows.Count).End(xlUp).offest(1)
End If
Next i
I know the code works as I tested it on another excel sheet, but on this specific one it gives problems. Is it because I have drop down lists as a manner of selection, instead of typing?
I would appreciate any help, as I am a complete novice in VB and don't know where to look for errors.
Thanks for any assistance I can get.
Cheers!
Related:
Transfer data from one excel worksheet to another automatically
Automatically transfer data from one sheet to another in excel - Best answers
How to transfer data from one sheet to another in excel automatically - Best answers
The code in post #3 would be a better option but you would need to change line #6 to:-
If Intersect(Target, Columns(7)) Is Nothing Then Exit Sub
Let us know your thoughts.
It would also be a good idea to upload a sample of your work book to a free file sharing site such as DropBox, ge.tt or Sendspace and then post the link to your file back here. That way we can have a good look at what you are up against. Please use dummy data in the sample.
I will bear in mind of the file upload next time.
Thanks a mill!!
Come back any time should you have any future queries.
Good luck!
Cheerio,
vcoolio.;