Vous êtes sur la page 1sur 3

SUPER PAGINA EXCEL

https://www.extendoffice.com/es/documents/excel.html

----------pasa toda la hoja de min a mayus--INSERTAR AL FINAL DEL CODIGO ESCRITO EN


VISUALBASIC

Private Sub Worksheet_Change(ByVal Target As Excel.Range)


If Target.Address = "$D$23" And Target.Value = "Yes" Then
Hoja10.Visible = True
Else
Hoja10.Visible = False
End If
If Target.Address = "$D$24" And Target.Value = "Yes" Then
Hoja3.Visible = True
Else
Hoja3.Visible = False
End If
If Target.Address = "$D$25" And Target.Value = "Yes" Then
Hoja11.Visible = True
Else
Hoja11.Visible = False
End If
End Sub

------------------------------------para no ver el proceso

Application.ScreenUpdating = False 'no ver�s el proceso en pantalla insertar al


principo
Application.ScreenUpdating = True 'no ver�s el proceso en pantalla insertar al
final

-------------------------------------------------------copiar direct en la hoja


caja combinada lista desplegable

Private Sub Worksheet_SelectionChange(ByVal Target As Range)


'Update by Extendoffice: 2017/8/15
'declarar variables
Dim xCombox As OLEObject
Dim xStr As String
Dim xWs As Worksheet

'esta linea hace que la variable xWs aplique a la hoja en cuestion


Set xWs = Application.ActiveSheet

'esta linea evita errores


On Error Resume Next

'esta linea dfine xcombox como la caja combinada


Set xCombox = xWs.OLEObjects("TempCombo")
'este bloque desaparece la caja de combo
With xCombox
.ListFillRange = ""
.LinkedCell = ""
.Visible = False
End With

If Target.Validation.Type = 3 Then
Target.Validation.InCellDropdown = False
Cancel = True
xStr = Target.Validation.Formula1
xStr = Right(xStr, Len(xStr) - 1)
If xStr = "" Then Exit Sub
With xCombox
.Visible = True
.Left = Target.Left
.Top = Target.Top
.Width = Target.Width + 5
.Height = Target.Height + 5
.ListFillRange = xStr
.LinkedCell = Target.Address
End With
xCombox.Activate
Me.TempCombo.DropDown
End If
End Sub
Private Sub TempCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift
As Integer)
Select Case KeyCode
Case 9
Application.ActiveCell.Offset(0, 1).Activate
Case 13
Application.ActiveCell.Offset(1, 0).Activate
End Select
End Sub

----------MOSTAR Y OCULTAR HOJAS CUANDO SE LLAMA LA MACROS

Sub IDA()
'
' IDA Macro
'

'
Sheets("Hoja1").Select
Sheets("Hoja2").Visible = True
Range("C11").Select
Sheets("Hoja2").Select
Range("C11").Select
End Sub
Sub VUELTA()
'
' VUELTA Macro
'
'
Sheets("Hoja2").Select
ActiveWindow.SelectedSheets.Visible = False
Range("B11").Select
End Sub

Vous aimerez peut-être aussi