Conditional Selection VBA code

  • Thread starter Thread starter Himansu
  • Start date Start date
H

Himansu

Hello everyone,

Anyone know vba (excel) that will let me:

1. go to the last cell in the worksheet
2. select that cell
3. delete everything in the cell
4. then select that cell and everything else if A9 is blank
5. delete the selection
6. SUBTOTAL the last row

--
This might seem a little confusing, but let me know if I need to be more
specific.

** Any help will be greatly appreciated.

Have a good day.
 
Himansu,

See comments inline.
1. go to the last cell in the worksheet
Define the "last cell in the worksheet"
2. select that cell
3. delete everything in the cell
This is fine
4. then select that cell and everything else if A9 is blank
Define "everything else"
5. delete the selection
6. SUBTOTAL the last row
Why do you want a subtotal on only one row?

Cheers,
Jason Lepack
 
Jason,

1. Last cell = ctrl + g | Special | select "Last cell"

4. "everything else" means:

If any cell after a9 is blank then go to that cell and select it while
selecting the last cell. This will give me a range.

5. Delete that range and subtotal what I select.

** Do you want me to provide you a template or screen shoot?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top