How to move a row to the next sheet when I input a certain value in a cell within that row?

jdlerry

New Member
Joined
Apr 6, 2021
Messages
32
Office Version
  1. 2016
Platform
  1. Windows
NEED HELP PLEASE. Thank you! I actually asked the same question before which is VBA codes. If someone can help me with the VBA code please.
 
It is an event trigger code. See image below. You need to double-click the Masterlist worksheet and paste the code there. No need to Insert Module or anything
I cannot find that view (very new into this) but attached is my view. So I think it partially worked, since it got deleted in the MASTERLIST tab. But I am not seeing it to the supposed destination. Thank you for your help!
 

Attachments

  • capture 2.PNG
    capture 2.PNG
    52.3 KB · Views: 4
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I cannot find that view (very new into this) but attached is my view. So I think it partially worked, since it got deleted in the MASTERLIST tab. But I am not seeing it to the supposed destination. Thank you for your help!
On that General, use drop down to select Worksheet. On the right dropdown should be Change.

Under View you can select Project Explorer
 
Upvote 0
Y
It is an event trigger code. See image below. You need to double-click the Masterlist worksheet and paste the code there. No need to Insert Module or anything
On that General, use drop down to select Worksheet. On the right dropdown should be Change.

Under View you can select Project Explorer
Okay, I got that and I am seeing some progress. When I hit ENTER it got deleted and routed me to the destination tab but the problem is, it did not copy anything. It's juts blank. You might want to check again this file since I updated the tab with the heading similar to the MASTERLIST tab https://www.dropbox.com/s/0fy2uokch6fmfqk/eMedical-Tracker-updated.xlsm?dl=0
Probably that is the problem,
 
Upvote 0
Y


Okay, I got that and I am seeing some progress. When I hit ENTER it got deleted and routed me to the destination tab but the problem is, it did not copy anything. It's juts blank. You might want to check again this file since I updated the tab with the heading similar to the MASTERLIST tab https://www.dropbox.com/s/0fy2uokch6fmfqk/eMedical-Tracker-updated.xlsm?dl=0
Probably that is the problem,
Actually, when you select any item from drop down list, it will trigger the macro. It is worksheet Change event. No need to press Enter at all.

Are you sure you have the code under Masterlist worksheet. Refer the sheet name, not Sheet3 since it can be anything. If still nothing happened. Save the file as xlsm (if not macro will get stripped off. Then open the file again to try run
 
Upvote 0
I just downloaded the file. You installed it under Module. This will not trigger.

Remove Module1, 2 3, etc. No use.

It should work. I have tested with my mock up data.

Ohh wait. I see that you now have other sheet with header. The writing should start on row 4. I need to change the way the next empty row
 
Upvote 0
Change the Function rowNext to this
VBA Code:
Function rowNext(ws As Worksheet) As Long
rowNext = ws.Cells(Rows.Count, "A").End(xlUp).Row + 1
If rowNext < 4 Then rowNext = 4
End Function
 
Upvote 0
Change the Function rowNext to this
VBA Code:
Function rowNext(ws As Worksheet) As Long
rowNext = ws.Cells(Rows.Count, "A").End(xlUp).Row + 1
If rowNext < 4 Then rowNext = 4
End Function
FINALLY! It is working. Thank you! But not so perfect. So as you can see, row 4 was already moved to the supposed destination. Questions:
1. How do you not leave a space? Like, the succeeding items should move up automatically and not leave a space.
2. On the screenshot, the rows 5 and onwards, are not working. It's not moving to another tab.
 

Attachments

  • Capture5.PNG
    Capture5.PNG
    24.5 KB · Views: 3
Upvote 0
FINALLY! It is working. Thank you! But not so perfect. So as you can see, row 4 was already moved to the supposed destination. Questions:
1. How do you not leave a space? Like, the succeeding items should move up automatically and not leave a space.
2. On the screenshot, the rows 5 and onwards, are not working. It's not moving to another tab.
So, you mean the Masterlist will have rows of data. Once the row 4 is moved to other sheet, the remaining data need to shift up.

If that is so, you can just put command to delete the row instead of just ClearContents
 
Upvote 0
No .. I cannot do that because you have drop down selection in that row. Let me see what is the best way
 
Upvote 0
H
So, you mean the Masterlist will have rows of data. Once the row 4 is moved to other sheet, the remaining data need to shift up.

If that is so, you can just put command to delete the row instead of just ClearContents
How do I do that? :(
 
Upvote 0

Forum statistics

Threads
1,217,429
Messages
6,136,575
Members
450,021
Latest member
Jlopez0320

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