Professional Documents
Culture Documents
Sub Auto_Open()
Msgbox "Hello ' I am in Module1' "
End Sub
Sometimes we need to know what the cell contains ie dates, text or formulas before taking a course of action. In this ex
message box is displayed. Replace this with a macro should you require another course of action.
Select
Select
Goto (a range)
Select To specify a macro to go to a specific range you can use the Goto method.
Here I have already named a range in my worksheet called "Sales". You
Select may also use an alternative method ie the Range select method. Naming a
range in excel is recommended rather than specifying an absolute cell
reference.
Sub GoHere()
Application.Goto Reference:="Sales" OR Range("Sales").Select
End Sub
i have use following code
Sub Goname()
Application.Goto reference:="name"
End Sub
Sub gogujarati()
Application.Goto reference:="gujarati"
End Sub
Sub gohindi()
Application.Goto reference:="hindi"
End Sub
Sub goenglish()
Application.Goto reference:="english"
End Sub
Sub gomaths()
Range("maths").Select
End Sub
Sub goscience()
Range("science").Select
End Sub
Sub gosocial_study()
Sub goenglish()
Application.Goto reference:="english"
End Sub
Sub gomaths()
Range("maths").Select
End Sub
Sub goscience()
Range("science").Select
End Sub
Sub gosocial_study()
Range("social_study").Select
End Sub
Sub gototal()
Range("total").Select
End Sub
n use the Goto method.
t called "Sales". You
elect method. Naming a
ing an absolute cell
nge("Sales").Select
Function MyName() As String
MyName = ThisWorkbook.Name
End Function
Function SheetName(rAnyCell)
Application.Volatile
SheetName = rAnyCell.Parent.Name
End Function
Formula Result
=MyName() #VALUE!
=MyFullName() #VALUE!
=CELL("filename") 'file:///opt/scribd/conversion/tmp/scratch8/21572660.xls'#$Sheet15
=sheetname(A1) #VALUE!
Sheet1