Hi there
Hopefully one of the experts can assist - Im dabbing in VBA without knowing it well
I have two sheets both with some protected cells (columns) but I want to allow a user to move rows from one sheet to the other. Both sheets are setup exactly the same.
So via some googling I have come up with the VBA below but it isnt quite working for me.
Here is my logic
1. Via an input box I have the user select which line want to move from "Pipeline" (that part is working fine), automatically unprotect the sheet and copy the row
2. Then go to the "Project Tracker", automatically unprotect the sheet, locate the last empty row and paste (this isnt yet working)
3. And I havent built this in yet, go back to the row that was selected in "Pipeline" and delete it
The code I have so far is below.....Im stuck at getting it to actually paste
Thanks for your help!
Sub MoveFromPipelinetoTracker()
'
' MoveFromPipelinetoTracker Macro
' Macro recorded 7/03/2011 by L036328
'
Sheets("Pipeline").Activate
Worksheets("Pipeline").Protect Password:="merlot", UserInterfaceOnly:=True
Dim a As Long, response As Long
a = Application.InputBox( _
Prompt:="Enter the Rownumber you want to move to the Tracker", _
Title:="Move rownumber:", Type:=1)
If a <> False Then
response = MsgBox("Are you sure.", vbYesNo)
If response = vbYes Then Rows(a).Copy
End If
Sheets("Project Tracker").Activate
Worksheets("Project Tracker").Protect Password:="merlot", UserInterfaceOnly:=True
Range("A65536").End(xlUp).Offset(1, 0).Select
Sheets("Project Tracker").Paste
End Sub
Hopefully one of the experts can assist - Im dabbing in VBA without knowing it well
I have two sheets both with some protected cells (columns) but I want to allow a user to move rows from one sheet to the other. Both sheets are setup exactly the same.
So via some googling I have come up with the VBA below but it isnt quite working for me.
Here is my logic
1. Via an input box I have the user select which line want to move from "Pipeline" (that part is working fine), automatically unprotect the sheet and copy the row
2. Then go to the "Project Tracker", automatically unprotect the sheet, locate the last empty row and paste (this isnt yet working)
3. And I havent built this in yet, go back to the row that was selected in "Pipeline" and delete it
The code I have so far is below.....Im stuck at getting it to actually paste
Thanks for your help!
Sub MoveFromPipelinetoTracker()
'
' MoveFromPipelinetoTracker Macro
' Macro recorded 7/03/2011 by L036328
'
Sheets("Pipeline").Activate
Worksheets("Pipeline").Protect Password:="merlot", UserInterfaceOnly:=True
Dim a As Long, response As Long
a = Application.InputBox( _
Prompt:="Enter the Rownumber you want to move to the Tracker", _
Title:="Move rownumber:", Type:=1)
If a <> False Then
response = MsgBox("Are you sure.", vbYesNo)
If response = vbYes Then Rows(a).Copy
End If
Sheets("Project Tracker").Activate
Worksheets("Project Tracker").Protect Password:="merlot", UserInterfaceOnly:=True
Range("A65536").End(xlUp).Offset(1, 0).Select
Sheets("Project Tracker").Paste
End Sub