Auto Data move to new Sheets

compaqact

New Member
Joined
Jun 14, 2011
Messages
1
Not coming from a VBA background I am trying to put together something quite simple, but I am struggling to do it. I have a spread sheet with numerous sheets within it containing accounts to sales people mappings. What I am trying to do is have the user choose a staus of "Send to Free Pool" in the "H'' column, the row is copied to a sheet called "Free Pool''. Once this process is complete the cell row must be deleted on the source worksheet. I have managed to get the move process to work, but it keeps on pasting the copied row to line 30, and continually overwrites the data as each row's satus is set, or ignores the FinalRow command and pastes it anywhere it likes.

Below is my VB script that I have cobbled together from a few sources (for ease of troubleshooting Sheet1 = Free Pool in the code below

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Sheets("Sheet1").Select
' Find the last row of data
Dim FinalRow As Long
FinalRow = Range("A65536").End(xlUp).Row

'Dim nextrow As Long
'nextrow = Range("A65536").End(xlUp).Row

If Target.Cells.Count > 1 Then Exit Sub

Application.ScreenUpdating = False

If Not Intersect(Target, Range("H7:H" & Cells(Rows.Count, "H").End(xlUp).Row)) Is Nothing Then
If Target.Value = "Send to Free Pool" Then
Range("A" & Target.Row & ":I" & Target.Row).Copy Destination:=Sheet1.Range("A" & FinalRow)
'Target.EntireRow.Delete
End If
End If

Application.ScreenUpdating = False

End Sub

Once I have this sorted I'm trying to figure out the best way to set the "H" column on the "Free Pool"" worksheet only, to active and the Macro asks which worksheet it should be copied to and performs the neccessary actions similar to the above code.

Any help would be greatly apreciated

Thanks

Andrew
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,224,505
Messages
6,179,147
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top