Crear formulario l Excel + macro
Para que el código funcione perfecto, las posiciones del formulario deben ser iguales a las del vídeo, osea posiciones E y F.
Código.
Sub Registrar()
'
' Ingresar Macro
'
Application.ScreenUpdating = False
Sheets("Formulario").Select
Range("F4:F7").Select
Selection.Copy
Sheets("Base_de_datos").Select
Range("A2000").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("A2:D2000").Select
Application.CutCopyMode = False
ActiveWorkbook.Worksheets("Base_de_datos").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Base_de_datos").Sort.SortFields.Add Key:=Range("A2"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Base_de_datos").Sort
.SetRange Range("A2:D2000")
.Header = xlNo
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("D1").Select
Sheets("Formulario").Select
Range("F4:F7").Select
Selection.ClearContents
Range("F4").Select
Application.ScreenUpdating = True
End Sub
Видео Crear formulario l Excel + macro автора Эксель для Шаблонов и Листов
Видео Crear formulario l Excel + macro автора Эксель для Шаблонов и Листов
Информация
6 декабря 2023 г. 5:10:32
00:12:55
Похожие видео