I would pick up the employee name from a list somewhere. If you really want a list of folders I suggest you do a search for 'FileSystemObject'.
This should give you the 'bones'
Sub test()
Dim BaseFolder As String
Dim MyName As String
Dim FileName As String
Dim FullFileName As...
Try using View TabOrder (= "z order") to set the sequene of controls instead of code.
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
Seems a bit longwinded to me.
All I do is show a suitably formatted textbox (from Drawing toolbar) and delete it when done.
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
Perhaps something like this. The first run changes the cell and locks it. Subsequently when the workbook is opened an error is produced which skips the lines of code. The other cells in the sheet need to be unlocked so the user can make changes.
Private Sub Workbook_Open()
Dim MyCell As...
Seems a strange question because all you need to do is to do the Save As when you will find it will do what you want.
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
Could go the whole hog :-
Sub test()
Application.Visible = False
UserForm1.Show
Unload UserForm1
Application.Visible = True
End Sub
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
I wonder if you can use something like this to stop the last workbook being closed. Need to add a bit more to make sure you can close it when you want to :-
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Workbooks.Count = 1 Then
MsgBox ("Cannot close last workbook yet.")...
Could try running another instance of Excel (in a similar way to running Word from Excel, or Excel from Word).
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
I stand corrected. (Blush)
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
Don't really know what you mean. If you want a picture of your form use keys Alt + PrintScreen and Paste in Word.
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
I have had lots more buttons on forms than that. How many other controls do you have on the form ? Make sure no controls overlap.
I would suspect some form of file corruption - which includes anything which might be in the workbook. When developing things poor old Excel cannot cope at times...
If you copy/paste & run the code I posted earlier you will see that this is not the case.
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
Making it hard for yourself. Just clear any comment and put the new one. No error is produced if the comment does not exist.
' partial code
ActiveCell.ClearComments
ActiveCell.AddComment ... etc.
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know...
Hopefully this code should answer your question :-
Sub test()
Dim MyVariable As Variant
'------------------------
Set MyVariable = ActiveSheet.Range("A1")
MsgBox (TypeName(MyVariable))
'---------------------------
MyVariable = "A string"
MsgBox (TypeName(MyVariable))...
Try :-
x = Application.WorksheetFunction.Sum(abc)
Regards
BrianB
Use CupOfCoffee to speed up all windows applications.
It is easy until you know how.
================================
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.