Help With Copy & paste

Aarondo

New Member
Joined
Jul 17, 2010
Messages
24
Hi, Im currently trying to "cut" the first row (with a value) in a specific column and paste it into a range on a different worksheet. For some reason it works when I use "copy" but doesnt work when I use "cut" any ideas?

Heres my code

Private Sub ChangeEvent3(ByVal Target As Range)
Worksheets("BackLog").Range("B1:B65536").End(xlDown).Copy
ActiveSheet.Paste Destination:=Worksheets("Sheet3").Range("M9")
End If
End Sub
 
Hi, thanks so much for taking the time with this one. However there seems to be a slight problem. It appears to be deleting all the entries in the column. Again I think its something to do with the function being called when the column its reading from is updated.
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
If you are calling that procedure in a loop, or in an event procedure that runs when Backlog is changed then it will work its way down column B. Perhaps you need to ensure that it only runs once. Something like

Code:
Private Sub ChangeEvent3()
Static RunOnce As Boolean
If Not RunOnce Then
    With Worksheets("BackLog")
        .Range("B1").End(xlDown).Copy
        Worksheets("Sheet3").Range("M9").PasteSpecial Paste:=xlPasteValues
        .Range("B1").End(xlDown).ClearContents
    End With
Else
    RunOnce = True
End If
End Sub
 
Upvote 0
Hi thanks for your helpfulness and your patience.

Im still having problems with it. If you have the time could you possibly have a look at it and see where Im going wrong.

This is my first try at coding with VBA so I dont even know if Im going about it the correct way. Basically what Im trying to achieve:

When the spreadsheet is connected to the web, cell "G9" is constantly updating. The values that are updated are then going onto a sheet called "BackLog" in "column b". Once the updated value in cell "G9" updates to 1.23 I am wanting it to launch the function to put the next one from column B on the "Backlog" sheet into cell "M9" on the main sheet.

I thaught the cut & paste method might be the best way but Im not sure.

Heres my sheet

My Spreadsheet
 
Upvote 0
Hi thanks for your reply.

I've already used the event change to gather the data which is then put in a list.

Is there a way to do the following?

(the function is executed) it selects row 1 column B
(the function is executed) it selects row 2 column B
(the function is executed) it selects row 3 column B

but I need it to do this automatically
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,992
Messages
6,122,631
Members
449,095
Latest member
bsb1122

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