column data clean

i hve  this solution working as needed

because need change data as soon as posible

need clean button  for data in column B and E
to add new data
54565758_b--1-.xlsm
ADRIANA PACCOUNTING ASSISTANTAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
you could try like this:

Sub test2()
    Dim StartRow As Integer, LastRow As Integer
    StartRow = 5
    LastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "B").End(xlUp).Row
    
    'Clear cells
    ActiveSheet.Range("B" & StartRow & ":B" & LastRow).Cells.Clear
    ActiveSheet.Range("E" & StartRow & ":E" & LastRow).Cells.Clear
End Sub

Open in new window

0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
ooops, should be like this instead:

Sub test2()
    Dim StartRow As Integer, LastRow As Integer
    StartRow = 5
    LastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "B").End(xlUp).Row
    
    'Clear cells
    If LastRow < StartRow Then Exit Sub
    
    ActiveSheet.Range("B" & StartRow & ":B" & LastRow).Cells.Clear
    ActiveSheet.Range("E" & StartRow & ":E" & LastRow).Cells.Clear
End Sub

Open in new window

0
Tom CieslikIT EngineerCommented:
You can do this by creating your own Macro and then create button with assigned Macro

First Enable Developer Tools

GO to File - Option - Customize Ribbon
On the left, check box Developer.

Click OK, now you should see Developer tab in Excel menu on the top

Click on Developer tool and Click on Record Macro
Select Name for Macro for Example DeleteData

Now select all fields you want delete.
Hit Delete Button
Now Click on Stop Recording.

In Developer tool click on Insert, and select Button

Place button where you want (make nice shape of it)
Select from Assign Macro Your Macro
Click OK

Now it's working

If you click on button it will delete fields defined in macro.

Capture.JPG
You can right click on button then left click to change button name

Capture.JPG
1
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Ryan Chong thnaks for the fast reponse

but how i used that ?? im not an expert computer
0
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Tom Cieslik   Thanks for the fast reponse

Great explanation   !!

you an Good Teacher
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
try customize this
54565758_b--1-_b.xlsm
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Ryan Chong

Captureqweds.PNG
0
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
change StartRow = 4

anyway, it seems working for me
0
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
i did but still the same

when i hit  the clear button
0
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Thnaks best  experts Ryan Chong   and Tom Cieslik
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.