deletion of rows

pradyuthal

Board Regular
Joined
Jul 13, 2005
Messages
212
If I delete cell a1 in sheet1 cell a1 through a10 in sheet2 will be deleted automatically. How can I delete the cell a1 sheet1 and its related cells a1 through a10 in sheet2? Please help me.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Not sure I completely understand where u r going - but here is a small code snipit to get you on the right path. Please comment if you need additional assistance with more specifics. You could also link to hot key if you want to avoid the input box (just set it to read in the current cell).

Sub DeleteData()
Dim rngToDelete As String
Dim blnConfirm As Boolean
Dim intDeleteRowStart, intDeleteRowEnd, intDeleteColumn As Integer
' Set the rows to delete on 2nd tab
intDeleteRowStart = 1
intDeleteRowEnd = 10
' Ask what to delete
rngToDelete = InputBox("Please enter cell to delete")

' Find column
Range(rngToDelete).Select
intDeleteColumn = Selection.Column
' Delete related cells
Range(rngToDelete).Select
Selection.Delete Shift:=xlToLeft
Sheets("Sheet2").Select
Range(Cells(intDeleteRowStart, intDeleteColumn), Cells(intDeleteRowEnd, intDeleteColumn)).Select
Selection.Delete Shift:=xlToLeft
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,558
Messages
6,179,512
Members
452,921
Latest member
BBQKING

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