Delete entire row of data in Excel sheets

Rizana

Board Regular
Joined
Jul 7, 2006
Messages
105
I'm working on a simple program that enabled the user to insert and delete data. The user will insert the data via VBE forms and will be saved in an Excel sheet.

The problem is that, I don't know what is the right VB codes to execute the actions?

I tried to use this code, but it doesn't seems to work.
Code:
Sheet12.Rows(i).EntireRow.Delete = True

Any ideas?
Thanks in advanced
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
If your sheet's name is "sheet12", and assuming that your "i" is a declared integer, then:
Code:
Sheets("sheet12").Rows(i).EntireRow.Delete
...should work.

If your sheet is the 12th sheet in a series, but called something else, then
Code:
Sheets(12).Rows(i).EntireRow.Delete
...should work.
 
Upvote 0
Hi Sykes,

if the sheet's code name is Sheet12 then
Code:
Sheet12.Rows(i).EntireRow.Delete
will work.
 
Upvote 0
Hi Glenn

Yes, you got there before me, didn't mean to post over you.
Also thanks for that - I've learnt something else there.

Regards
 
Upvote 0
Thanks a lot

Hello Sykes n GlennUK,

Thank you sooo much for the solution. I'm not familiar with this language and everything seems so hard for me even for an easy problem like this.

Thank you soo much.

Regards,
Rizana
 
Upvote 0
It's a pleasure
I'm self-taught, and as you can see from my earlier post, am still learning all the time!!
 
Upvote 0
My pleasure too. I am also self-taught, and am still learning after many many years of working with Excel and VBA.
 
Upvote 0

Forum statistics

Threads
1,214,806
Messages
6,121,672
Members
449,045
Latest member
Marcus05

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