Delete selection based on a differnt worksheet row.

hmaveal

New Member
Joined
Sep 22, 2010
Messages
11
Not sure if I can even do this. I have a sheet1 with current materials.
Once I used the materials and want to delete the row I would like a macro to go to another spreadsheet and delete a range before the sheet1 row deletion.

e.g. Cell E5 in sheet1 is going to be deleted. I need cells R5:T5 deleted from sheet2 before the sheet1 row is deleted. It will always be the same row as sheet1 and always the same columns on sheet2.

So.... 1. Select a row on sheet1 (remember it) (X)
2. Go to the same ROW on sheet2 and clears contents of R(x):T(x)
3. Return to the original row on sheet1 and delete the row.


any help at all is appreciated.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try:

Code:
Public Sub hmaveal()
Dim rRow As Long
rRow = ActiveCell.row
Sheets("Sheet2").Range("R" & rRow).Resize(1, 3).ClearContents
Sheets("Sheet1").rows(rRow).Delete
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

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