As far as I know the only way to apply a name to a workbook is to save it with the required name.
[tab]ActiveWorkbook.SaveAs [A1] & ".xls"
Or have I missed something ?
A.C.
If you have a TextBox1 and TextBox2 the following code will Tab from TextBox1 to TextBox2 :
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
If KeyCode = 9 Then TextBox2.Activate
End Sub
You can repeat the same idea...
Something like :
Sub FindSheet()
On Error GoTo ErrHandler
Sheets(InputBox("Enter Name of Sheet to Activate :")).Activate
Exit Sub
ErrHandler:
MsgBox "Sheet not found"
End Sub
A.C.
You can disable the button with th e following code :
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = True
End Sub
To actually remove the button (x) would require some API calls.
A.C.
If macros are disabled, the macro to enable macros would be disabled.
If it was possible to enable macros by using code then there would be no security at all.
What you need to do is to investigate the use of digital signatures. See the following MSDN aricle ...
Try the following code which should change the color of an AutoShape named "MyShape", based on the value in A1.
[code]
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
With ActiveSheet.Shapes("MyShape").Fill.ForeColor
Select...
You can use the KeyDown event of the control to do what you want. For example if you have 2 Textboxes on your sheet, when you are in TextBox1 and hit th eTab key, the following code will activate TextBox2 :
[code]
Private Sub TextBox1_KeyDown( _
ByVal KeyCode As MSForms.ReturnInteger, _...
To delete code from a protected VBA project you would need the Password (or a Password cracker).
None of the information or the link I provided would enable tampering with protected code.
I can assure you that I would in no way aid and abet any attempt to 'crack' any code.
Regards,
A.C.
It is very easy to establish if any particular workbook is protected or not interactively by simply trying to acces the code. So why not make the same process simple via code ?
I do not think cbdsolutions needs to explain to me why he is trying to do something. I have no reason to think he is...
If a DoubleClick is acceptable you can use something like the following :
Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Range("A1:F20"), Target) Is Nothing Then
If Target = "x" Then...
The following function should return True if a workbook's VBA code is protected :
Function ProtectedCode(WB As Workbook) As Boolean
ProtectedCode = WB.VBProject.Protection
End Function
You can use
[tab]ActiveWorkbook.VBProject.Protection
for the active workbook.
You can...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.