Страницы: 1
Две формы на листе
 
Господа помогите плиз на листе активирована форма    
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)  
   If Selection.Cells.Count > 1 Then Exit Sub  
   If Not Intersect(Target, Range("G4:G65000")) Is Nothing Then  
       Cancel = True  
       UserForm1.Show  
   End If  
End Sub  
 
Хочу активировать форму 2 по столбцу I тоже по двойному клику. Как это сделать?  
Спасибо. Слаб в ВБА
 
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)  
If Selection.Cells.Count > 1 Then Exit Sub  
If Not Intersect(Target, Range("G4:G65000")) Is Nothing Then  
UserForm1.Show  
End If  
If Not Intersect(Target, Range("I4:I65000")) Is Nothing Then  
UserForm2.Show  
End If  
End Sub
 
{quote}{login=Лузер™}{date=23.09.2008 02:05}{thema=}{post}Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)  
If Selection.Cells.Count > 1 Then Exit Sub  
If Not Intersect(Target, Range("G4:G65000")) Is Nothing Then  
UserForm1.Show  
End If  
If Not Intersect(Target, Range("I4:I65000")) Is Nothing Then  
UserForm2.Show  
End If  
End Sub{/post}{/quote}  
 
Спасибо как все просто когда знаешь.
 
Не подскажете как, чтобы после окончания ввода данных из формы,мышь перескакивала на ячейку A этого же ряда.  
With Sheets("")  
       Dim iLastRow As Long  
       iLastRow = .Cells(.Rows.Count, 2).End(xlUp).Row + 1  
       .Cells(iLastRow, 2) = CDate(Me.TextBox1.Value)  
       .Cells(iLastRow, 3) = Me.TextBox2.Value  
       .Cells(iLastRow, 4) = Me.TextBox3.Value  
       .Cells(iLastRow, 5) = Me.TextBox4.Value  
       .Cells(iLastRow, 6) = Me.TextBox5.Value  
       .Cells(iLastRow, 7) = Me.TextBox6.Value  
       .Cells(iLastRow, 8) = CDate(Me.TextBox7.Value)  
       .Cells(iLastRow, 12) = Me.TextBox8.Value  
         
         
         
   End With
Страницы: 1
Читают тему
Наверх