Delete row in two worksheet at same time

jdcar

Board Regular
Joined
Apr 27, 2012
Messages
163
Hi everyone
I have a userform, with a combobox, and from that I transfer data to a main worksheet(1)-(table),
but some especif data, depending on the kind of it, transfer as well to another worksheet(2).
This works well, but when I want to delete a especific data in determinate row in sheet1 it delete just in sheet 1 and didn't delete in worksheet2.
Are there any solution for this? How to use code vba to do that? Thank you
The code that I use to transfer to sheet2 is:
VBA Code:
[TABLE]
[TR]
[TD]Dim rng As Range[/TD]
[/TR]
[TR]
[TD]If cboP.Value = "Stones" Then[/TD]
[/TR]
[TR]
[TD]Set rng = Worksheets("sheet2").Cells(Rows.Count, "c").End(xlUp).Offset(1, 0)[/TD]
[/TR]
[TR]
[TD]rng.Offset(0, 3) = cboDesp.Value[/TD]
[/TR]
[TR]
[TD]rng.Offset(0, 4) = txtvt.Value[/TD]
[/TR]
[TR]
[TD]rng.Offset(0, 5) = txtob.Value[/TD]
[/TR]
[TR]
[TD]End If[/TD]
[/TR]
[/TABLE]
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

jdcar

Board Regular
Joined
Apr 27, 2012
Messages
163
VBA Code:
Dim rng As Range    
     If cboP.Value = "Stones"  Then    
         Set rng = Worksheets("sheet2").Cells(Rows.Count,    "c").End(xlUp).Offset(1, 0)    
               rng.Offset(0, 3) = cboDesp.Value    
               rng.Offset(0, 4) = txtvt.Value    
               rng.Offset(0, 5) = txtob.Value    
     End If
 

Watch MrExcel Video

Forum statistics

Threads
1,127,082
Messages
5,622,567
Members
415,907
Latest member
Walters87

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
Top