Hi I have a requirement
when a particular row is deleted in sheet1, the corresponding row should be automatically deleted from sheet2. column A in both the sheets is ID field which is unique.Please help to solve this problem
Hi I have a requirement
when a particular row is deleted in sheet1, the corresponding row should be automatically deleted from sheet2. column A in both the sheets is ID field which is unique.Please help to solve this problem
in both sheets those unique ID is in the same row or before delete you have to check ID's position in sheet 2 ?
Best Regards
I don't think it's possible to trap a row being deleted manually so that code can automatically do what you are asking. The only way really would be to use the code to delete the rows on both sheets.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
the unique id in both the sheets is in different rows but they are in column A
I hope solution for your problem is made - check attached file
@Domski - never say never ;-)
Best Regards
Last edited by MaczaQ; 06-09-2011 at 07:10 AM.
Good thinking although your workbook open event will fall over as Me.UsedRange is not valid. You would also need to trap for multiple rows being deleted.
Dom
hi Maczaq...appreciate for your help..but it is throwing some error in Usedrange when the sheet is opened..can you please see to it
correct file attached
error is solved
multiply row delete now is available too (thanks Domski for info)
Best Regards
thanks a lot...can you please tell me how to import this code so that it works perfectly
hi
Press ALT+F11 in your document (VBA editor should appear)
drop menu View -> Project Explorer (make sure it is open, should be on the left side)
click twice on Sheet1 and paste there a code:
Then press twice on ThisWorkbook and past following codePlease Login or Register to view this content.
Consider to mark this thread as solved and if you are satisfacted as well please click on my reputation's add buttonPlease Login or Register to view this content.
Best Regards
Hi,
I know I'm being picky and would have a go myself if I didn't have so much on today but I'm not sure that will work with multiple rows, especially if the user were to select more then one that were non-contiguous.
Dom
You have right Domski - provided solution works fine only for one deleted row or for selected rows (row by row)
I will think about update to catch that
Thanks for your ideas
Best Regards
Hello All,
I update the script, now it works for non-contiguous selections.
I hope no more bugs
Best Regards
MaczaQ
hi Maczaq..Thanks a lot for your help..appreciate your efforts to solve the issue...
hi mohan308
I see You have satisfaction and so have I.
Please consider to mark this thread as SOLVED and if you want click on add button to add me reputations points
Best Regards
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks