Skip to content

Instantly share code, notes, and snippets.

View tombrad's full-sized avatar

Tomas Bradanovic tombrad

View GitHub Profile
@tombrad
tombrad / gist:4880005
Created February 13, 2013 02:14
Curso VBA-11
‘ Programa para llenar automáticamente un formulario en word
‘ Lo que está escrito con comilla simple son solo comentarios para explicar el programas, pueden omitirse
‘ With… EndWith sirve para no tener que repetir la misma instrucción en cada línea, en este caso Selection
With Selection
.ParagraphFormat.LineSpacingRule = wdLineSpaceSingle ‘Coloca espacio de líneas en “espacio simple”
.TypeParagraph ‘Pasa a linea siguiente
.TypeParagraph ‘Pasa a linea siguiente
.Font.Bold = True ‘Coloca negrita
.TypeParagraph ‘Pasa a linea siguiente
@tombrad
tombrad / gist:4868211
Created February 13, 2013 02:06
Curso VBA-10
Sub formulario1()
‘ formulario1 Macro
‘ Macro creada el 26/07/2010 por INTEL
UserForm1.show
End Sub
@tombrad
tombrad / gist:4727049
Created February 6, 2013 23:54
Curso VBA-9
Application.PrintOut FileName:=”Permiso.doc”, Range:=wdPrintCurrentPage, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:=”", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False
Selection.WholeStory
Selection.Delete Unit:=wdCharacter, Count:=1
Unload UserForm1
@tombrad
tombrad / gist:4727041
Created February 6, 2013 23:52
Curso VBA-8
Curso VBA-8Sub Macro2()
‘ Macro2 Macro
‘ Macro grabada el 24-12-98 por TOMAS BRADANOVIC
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
@tombrad
tombrad / gist:4727007
Created February 6, 2013 23:48
Curso VBA-7
Private Sub CommandButton1_Click()
With Selection
. Font.Size = Val(10)
. ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
. TypeParagraph
. Font.Name = “arial black”
. ParagraphFormat.Alignment = wdAlignParagraphCenter
. TypeText Text:=vbTab & “Programa de Prueba”
. ParagraphFormat.Alignment = wdAlignParagraphLeft
. TypeParagraph
@tombrad
tombrad / gist:4726998
Created February 6, 2013 23:47
Curso VBA-6
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.Text = UCase(TextBox1.Text)
End Sub
@tombrad
tombrad / gist:4726988
Created February 6, 2013 23:46
Curso VBA-5
Sub prueba1()
UserForm1.show
End Sub
@tombrad
tombrad / gist:4726962
Last active December 12, 2015 06:08
Curso VBA-4
Private Sub CommandButton1_Click()
tdolares.Text = “”
tpesos.Text = “”
End Sub
Private Sub tdolares_Change()
End Sub
Private Sub tdolares_Exit(ByVal Cancel As MSForms.ReturnBoolean)
@tombrad
tombrad / gist:4726958
Created February 6, 2013 23:43
Curso VBA-3
Private Sub CommandButton1_Click()
tdolares.Text = “”
tpesos.Text = “”
End Sub
@tombrad
tombrad / gist:4726952
Created February 6, 2013 23:42
Curso VBA-2
Private Sub tpesos_Exit(ByVal Cancel As MSForms.ReturnBoolean)
tdolares.text = Val(tpesos.text) /500
End Sub