Professional Documents
Culture Documents
VB VBA VB
Dim
Dim a as integer ' a
Dim a ' a
Dim a as string ' a
Dim a as currency ,b as currency ,c as currency ' a,b,c
......
ByteBooleanIntegerLongCurrencySingleDoubleDecimalDateString
String * lengthObjectVariant
Option Explicit
Const
'
Private
Const My = 456
' Public
Public Const MyString = "HELP"
'
Const MyStr = "Hello", MyDouble As Double = 3.4567
EXCEL97
Sub My_Select
Selection.CurrentRegion.Select
End sub
sub my_trim
msgbox Trim(ActiveCell.Value)
end sub
sub my_offset
ActiveCell.Offset(0, 1).Select'
ActiveCell.Offset(0, -1).Select'
ActiveCell.Offset(1 , 0).Select'
ActiveCell.Offset(-1 , 0).Select'
end sub
sub
end sub
!
ActiveCell.Value = ""
""
Range("a1").value="hello"
2.
Sheets("sheet1").Range("a1").Value = "hello"
1.sheet2
HELLO"A1
2.sheet2 HELLO" sheet2 A1
' SHEET1
sheets("sheet1").Visible=False
' SHEET1
sheets("sheet1").Visible=True
EXCEL SHEET
Dim my As Worksheet
For Each my In Worksheets
my.PrintPreview
Next my
msgbox ActiveCell.Address
ActiveSheet.Protect
ActiveSheet.Unprotect
"liu"
ActiveSheet.Name = "liu"
AppActivate (Shell("C:/WINDOWS/CALC.EXE"))
Worksheets.Add
activesheet.delete
ActiveWindow.Close
Selection.HorizontalAlignment = xlLeft
Selection.HorizontalAlignment = xlCenter
Selection.HorizontalAlignment = xlRight
Selection.Style = "Percent"
Selection.Font.Bold = True
Selection.Font.Italic = True
20
With Selection.Font
.Name = ""
.Size = 20
End With
With
With
.
End With
ActiveCell.Clear '
MsgBox Selection.Rows.Count
MsgBox Selection.Columns.Count
Selection.Address
ON ERROR RESUME NEXT
kill "c:/1.txt"
Application.StatusBar = false
Application.Run macro:="text"
a1
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollColumn = 1
inputbox<>
XX=InputBox ("Enter number of months to add")
Dim kk As String
zoom
Application.Dialogs(xlDialogZoom).Show
Application.Dialogs(xlDialogActiveCellFont).Show
Dim kk As String
kk = Application.GetSaveAsFilename("excel (*.xls), *.xls")
Workbooks.Open kk