just tested it and it says it is a mismatch
just tested it and it says it is a mismatch
having a bad day as should have found
just for anyone reading this it is four commas as below (but you would see that anyway!)
Application.GetOpenFilename("Xl Files (*.xls), *.xls", , , , True)
Thanks very much for your help that is great
sorry i was supposed to attach that too!
Private Function GetAttach() As String
Dim strFileFullPath As String
strFileFullPath = Application.GetOpenFilename("Xl Files (*.xls), *.xls")
If strFileFullPath = "False" Then Exit Function
GetAttach = strFileFullPath
I have a form that attaches files to emails out of a specific folder.
My problem is i can only select one file from the folder and i need to attach more than one.
Does a0nyone know how to allow multiple attachments, i have tried "ctrl" and clicking on more than one but no joy and "shift" and the arrow keys.
Any ideas on this?
Here is my code
Private Sub CommandButton3_Click() ' setting and attaching the work book Dim MyPath As String Dim SaveDriveDir As String Dim saveasname As String SaveDriveDir = CurDir MyPath = "c:\eform\local" ChDrive MyPath ChDir MyPath Attachment1 = GetAttach attach.Text = Attachment1 ChDrive SaveDriveDir ChDir SaveDriveDir End Sub
I thought as much with replace but what is really strange is the use of range not working!
oh well i will think of something!
I am running excel 2003 and i tried to run this code on excel 97 and it would not work. Does anyone know why? The compiler highlights Range and Replace.
ActiveWorkbook.SaveAs Filename:="C:\sch\" & Range("b10") & "_" & Range("b11") & "_" & Replace(Date, "/", "-") & "_" & Replace(Format(Time, "HH:MM AM/PM"), ":", "-") & ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
I can do this but i was not clear in what i need..
I need to hide the password in the code, is that possible?
Is there a way of putting a password on a macro button.
I.e user clicks on it and the user is prompted to enter a password.
I have done this in other code but not sure for vb
Think im getting worse at this......
I want to be able to write in a cell 1min 30sec i.e i would enter 1.3. and it would understand that was 1min 30secs.
Is this a format option ( i doubt it) or as i expect a formula!
Help would be greeeeaaaat
thanks for that, do you know how to hide the letters
so for example i enter 1m and it should just show the 1 with the colour.
i.e o = yellow, so i enter 1o, it changes the cell to yellow but the o disappears(changes to yellow, maybe thats what it should do?) so the final outcome is the cell shows 1 and is yellow!
Someone yesterday kindly helped with a scenario where if i entered 1 in a cell it would turn yellow.
Is there a way that if i entered 1m for example it would turn yellow?
My current code is this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then
Select Case Target
Target.Interior.ColorIndex = 6
Target.Interior.ColorIndex = 41
Target.Interior.ColorIndex = xlNone
If someone enters in a cell(say a1) 1 then it will colour the cell yellow
If they had entered 2 then blue.
Is that possible to do in vb??
cheers ! thanks for your help
Is it possible in a vba form to limit what type of character can be inputed in a combo box.
I want it to limited to just numbers
I have looked through the properties but seem to be blind!!
Thanks in advance
ok got it now, i have been using a workbook and from your excellent help i have done this!!
Thanks very much
yes, i put that in the value but it did not work,
i tried roys and it keep picking up the wrong file name (gives the other open sheet) ? Where in my code should i have this???
I want that when i launch my userform the activesheet saved location is shown in a text box (textbox1)
How can this be done?
yep done it!
dont spend anymore of your time on this but if there is a way so you would have to only type in a small part of the file name i.e test rather than test_true that would be greater beneficial
OK i have got this working but i have to enter the full path, is it not possible to put part of the file name in?
i.e file location is c:\sch\test1_tue.xls
If i was to make this look in this folder c:\sch\
is it possible if i just typed in test1 that it would return the excel sheet test1_tue??
Is it possible to use the code to look in a specific cell for part of the saved worksheet name when i have defined what directory to look in?
Im not sure if im understanding the code properly but this is what im trying to get to.
Example:- file im looking for in directory C:\sch is called 5555.
On the find spreadsheet i want it to look in cell a1 (for example), in which i have typed that file name 5555 and then by a click of a button it opens that spreadsheet?