![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: iceland
Posts: 138
|
Hi guys.
I have greated a Userform (userform3),this userform3 has two buttons, commandbutton1 and commandbutton2. Commandbutton2 hides the userform3, COMMANDBUTTON1 is suppose to delete range A10;A11 and B10 AND then hide the userform3, BUT it does not work correctly, COMMANDBUTTON! only hides userform3, it does not delete A10:A11 and B11. My cose is as follows. Private Sub CommandButton1_Click() Dim r1 As Range, r2 As Range, myMultiAreaRange As Range Worksheets("sheet1").Activate Set r1 = Range("A10:A11") Set r2 = Range("B10") Set myMultiAreaRange = Union(r1, r2) myMultiAreaRange.Delete Shift:=xlShiftToLeft UserForm3.Hide End Sub Private Sub CommandButton2_Click() UserForm3.Hide End Sub can anyone see what i am doing wrong in Commandbutton1. BK Stulli |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: iceland
Posts: 138
|
Sorry, I have found my error.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|