Coding Help

TaylorGall

New Member
Joined
Jun 6, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am familiar with using formulas in excel but am struggling with this one as I believe this requires coding.

What I am looking for this to do is the following.

If I type 'OFFSHORE' into column E, the entire row will be moved to the 'OFFSHORE' sheet. Removing the original row from the 'ONSHORE' sheet.
The same for, If I type 'RECERT' or 'REPAIR' into column E, the entire row will be moved to the 'AWAY FOR REPAIR OR RECERT' sheet. Removing the original row from the 'ONSHORE' sheet.

I would also like this to work the other way round.
If when in sheet 'OFFSHORE', I type 'ONSHORE' into column E, the entire row will be moved to the 'ONSHORE' sheet. Removing the original row from the 'OFFSHORE' sheet.
Or I type 'RECERT' or 'REPAIR' into column E, the entire row will be moved to the 'AWAY FOR REPAIR OR RECERT' sheet. Removing the original row from the 'OFFSHORE' sheet.

If when in sheet 'AWAY FOR REPAIR OR RECERT', I type 'ONSHORE' into column E, the entire row will be moved to the 'ONSHORE' sheet. Removing the original row from the 'AWAY FOR REPAIR OR RECERT' sheet.
Or I type 'OFFSHORE' into column E, the entire row will be moved to the 'OFFSHORE' sheet. Removing the original row from the 'AWAY FOR REPAIR OR RECERT' sheet.

Please see attached for reference.

Any help would be greatly appreciated.

Regards
Taylor
Inventory List Microsoft Code.png
 
Click here to download your file. In the ONSHORE sheet, change REPAIR or ONSHORE in column E to OFFSHORE and press the ENTER key. This will move that line to the OFFSHORE sheet. Next, in the OFFSHORE sheet, change OFFSHORE to REPAIR and the line will be moved to the AWAY FOR REPAIR OR RECERT sheet.
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi,

The only line which which states 'EventsEnable False' is the one which you had sent across for me to enter into the Module tab.

I am still having no luck getting the code to do anything.

1718213016060.png


1718213063748.png
 
Upvote 0
Did you try the file I attached to Post #11?
 
Upvote 0
Did you try the file I attached to Post #11?
Hi have just downloaded the file attached..

I can see the codes that you have entered and that you have managed to move one of the rows to another sheet.

However, for some reason whenever I change anything in row 'E' nothing happens.
Unsure what I am doing wrong.

Thanks.
 
Upvote 0
I just tried the file again and it works properly. This line of code will disable the event macro if it errors out:
VBA Code:
Application.EnableEvents = False
Try running this short macro to enable events first and then try entering a value in column E pressing the ENTER key after entry.
VBA Code:
Sub test()
    Application.EnableEvents = True
End Sub
 
Upvote 0
I just tried the file again and it works properly. This line of code will disable the event macro if it errors out:
VBA Code:
Application.EnableEvents = False
Try running this short macro to enable events first and then try entering a value in column E pressing the ENTER key after entry.
VBA Code:
Sub test()
    Application.EnableEvents = True
End Sub
Hi,

Apologies to you all,
There was nothing wrong with any of your coding all along.

I have just figured out that the reason it was not working was due the macro's being disabled in my file.
I have now Enabled all macros and changed the properties to unblock to prevent microsoft from blocking the file.

It was just a simple fix after all.

All working now, working in all directions from sheet to sheet, exactly how I wanted it!

Thank you all for your help! :)
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,793
Members
451,589
Latest member
Harold14

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