Double Macros

dvuppx

New Member
Joined
Aug 31, 2017
Messages
12
I have a macro which works lovely on one of my tabs, which if i put a YES in column BR it moves it from 121 c+d to 121 Disch. this is it:

Option Explicit


Private Sub Worksheet_Change(ByVal Target As Range)
'' dvuppx
'
Dim Ws As Worksheet

Application.EnableEvents = False


On Error GoTo Xit
If Target.Column <> 70 Or UCase(Target.Value) <> "YES" Then GoTo Xit


Set Ws = Sheets("121 Disch")
Target.EntireRow.Copy Ws.Range("A" & Rows.Count).End(xlUp).Offset(1)
Ws.Range("BQ" & Rows.Count).End(xlUp).Offset(, 1) = Date
Target.EntireRow.Delete
Xit:
Application.EnableEvents = True


End Sub


its beautiful and it works. However. I have another tab on the same spreadsheet called DH WL which is a waiting list for either DH Wed or DH Fri. On DH WL, there is information which i enter in columns a-c. i would like to be able to go onto DH WL and in column D write either Wed or Fri to allocate that entry, the information in columns a-c, to be relocated to tab 'DH Wed' or 'DH Fri', and delete column D where ive written either wed or fri for the allocation, if that makes sense.

Additionally, in tab DH wed and FRI, instead of in columns a-c i need the information to be put into the next available columns T to V. When trying to do this, i cant seem to rearrange the macro to fit and also when i put it in, it says that the worksheet_change reference is too ambiguous. can anyone help here?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi,

If you want to handle events from different worksheet then the easy way is to create a Worksheet_Change macro for each sheet. Then you write the code relevant to that sheet in that macro.

I hope I have understood the issue correctly.


Regards,
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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