Code to delete row

uwish7

New Member
Joined
Jul 26, 2017
Messages
26
I want to create a vba code for sheet one that says if color and shape are the same/duplicate, delete the newest one. How would I dim the color and shape? I want to create a button for the user to press to start the sequence.
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
.
How would you know which one is the newest ?
 
Upvote 0
I want to create a vba code for sheet one that says if color and shape are the same/duplicate, delete the newest one. How would I dim the color and shape? I want to create a button for the user to press to start the sequence.
The title of your thread says you want to delete a row whereas the description in the thread seems to be saying you want to delete shape... please clarify what you want and provide some more detail about what your existing layout looks like.

A Generalized "Please Note"
--------------------------------------
One thing you must keep in mind when you ask a question in a forum... the people you are asking to help you know absolutely nothing about your data, absolutely nothing about how it is laid out in the workbook, absolutely nothing about what you want done with it and absolutely nothing about how whatever it is you want done is to be presented back to you as a result... you must be very specific about describing each of these areas, in detail, and you should not assume that we will be able to "figure it out" on our own. Remember, you are asking us for help... so help us to be able to help you by providing the information we need to do so, even if that information seems "obvious" to you (remember, it is only obvious to you because of your familiarity with your data, its layout and the overall objective for it).
 
Upvote 0
Please excuse me. Let me explain.
I have 11 rows across. They are listed below. If the color and shape are the same, based on the date, delete the newest date.
So for example if you have August 30 and a circle and purple, Aug 30 will be deleted.
I also want to create a button to start the operation. I know how to create a button but I do not know how to code it. I have Excel 2016. I mainly do not know how to dim. The worksheet is labeled Inventory Out. the shapes can be numerical. The shapes are coded for a numeric number. I hope this helps.
[TABLE="width: 1195"]
<tbody>[TR]
[TD="width: 59"]

[/TD]
[TD="width: 79"]

[/TD]
[TD="width: 324"]

[/TD]
[TD="width: 67"]

[/TD]
[TD="width: 77"]

[/TD]
[TD="width: 88"]

[/TD]
[TD="width: 92"]

[/TD]
[TD="width: 97"]

[/TD]
[TD="width: 392"]

[/TD]
[TD="width: 202"][/TD]
[TD="width: 114"][/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 1195"]
<tbody>[TR]
[TD="width: 59"]Date
[/TD]
[TD="width: 79"]Shape
[/TD]
[TD="width: 324"]Material Description
[/TD]
[TD="width: 67"]Color
[/TD]
[TD="width: 77"]Cntl
[/TD]
[TD="width: 88"]ColorType
[/TD]
[TD="width: 92"]Search Criteria
[/TD]
[TD="width: 97"]Planner
[/TD]
[TD="width: 392"]Notes
[/TD]
[TD="width: 202"]Impact
[/TD]
[TD="width: 114"]Metric
[/TD]
[/TR]
[TR]
[TD]27-Aug
[/TD]
[TD]square
[/TD]
[TD]Color Name
[/TD]
[TD]purple
[/TD]
[TD]z2
[/TD]
[TD]x
[/TD]
[TD]purpleSquare
[/TD]
[TD]Jane
[/TD]
[TD="width: 392"]Update Info
[/TD]
[TD="width: 202"]None
[/TD]
[TD]OUT
[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"]27-Aug
[/TD]
[TD="bgcolor: transparent"]circle
[/TD]
[TD="bgcolor: transparent"]ColorName
[/TD]
[TD="bgcolor: transparent"]purple
[/TD]
[TD="bgcolor: transparent"]z6
[/TD]
[TD="bgcolor: transparent"]x
[/TD]
[TD="bgcolor: transparent"]PurpleCircle
[/TD]
[TD="bgcolor: transparent"]Doe
[/TD]
[TD="width: 392, bgcolor: transparent"]Waiting for update
[/TD]
[TD="width: 202, bgcolor: transparent"]None -
[/TD]
[TD="bgcolor: transparent"]OUT
[/TD]
[/TR]
</tbody>[/TABLE]

If the Shape and Color are the same, based on the date, delete the newest date
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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