Move up other cell values one row after a row deletion code has been run

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Morning,

I have the working code supplied below but wish to add some code or get advice for adding some extra code to it.

On my worksheet called G INCOME i have a section which contains some information regarding my customers,i have attached a screen shot for you.
The first entry will always be N4

So the code will delete a customers entry lets say in this case ISABEL of which is at row 13
It deletes it fine but this leaves row 13 empty.
The advice i need would be to copy / paste the entries below & move them up 1 row.

Currently im having to manualy do this each time.

For your information i also have other info on the worksheet so we need to keep within the range of this otherwise that rows info will also be deleted / altered etc
Thanks.


Rich (BB code):
Private Sub DeleteCustomer_Click()
    If ActiveCell.Column = 14 And ActiveCell.Row > 3 And ActiveCell.Value <> "" Then
    Dim Answer As Long
    Answer = MsgBox("ARE YOU SURE YOU WISH TO DELETE THIS CUSTOMER", vbYesNo + vbCritical, "DELETE GRASS CUTTING CUSTOMER")
    If Answer = vbYes Then
        ActiveCell.Resize(1, 5).ClearContents
    Else
        Exit Sub
    End If
    Else
       MsgBox "NO CUSTOMER WAS SELECTED", vbExclamation, "DELETE GRASS CUTTING CUSTOMER"
    End If
End Sub
 

Attachments

  • 2085.jpg
    2085.jpg
    132.5 KB · Views: 5
Change the formula in the GRASSTABLE named range to: =OFFSET('G INCOME'!$N$4,0,0,COUNTA('G INCOME'!$N:$N),1)
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
No apologies necessary. I'm glad it worked out. :)
 
Upvote 0

Forum statistics

Threads
1,215,421
Messages
6,124,806
Members
449,191
Latest member
rscraig11

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