Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. mar050703

    ExportAsFixedFormat

    No worries, me being silly :( If Dir(UCase(filestr & "Draft TEST" & "v" & count & ".pdf")) = "" Then ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=filestr & " Draft TEST" & "v" & count notice the "SPACE" before the word "DRAFT" on the 2nd line, and not on the...
  2. mar050703

    ExportAsFixedFormat

    Thank you for your suggestion. The code is not bringing any errors, it just overwrites the file it creates, (I can see that from the time stamp in windows explorer. It is as if the loop is not working, but am unable to figure out why. The first instance is naming the file correctly in the...
  3. mar050703

    ExportAsFixedFormat

    Thanks Andrzejek, Your code works perfectly in my simple test version. Unfortunately in my live version (with a little more coding etc) again appears to overwrite the file My Live code is: Dim Fnme As String Dim Fpath As String Dim filestr As String Dim count As Integer Dim bln As Boolean...
  4. mar050703

    ExportAsFixedFormat

    Thanks for the code. Unfortunately, I am still only getting "test.pdf", therefore if the is a "Test.pdf" I am still unable to get "Testv1.pdf". When testing, I am closing the file before attempting a "Testv1.pdf". Any further ideas would be appreciated. Thanks
  5. mar050703

    ExportAsFixedFormat

    Thanks Andy, that explains the problem, Can you suggest a solution please? I have tried If Dir(filestr & "v" & count) = "" Then ActiveSheet.ExportAsFixedFormat Type:=xltypepdf, filename:=filestr Else ActiveSheet.ExportAsFixedFormat Type:=xltypepdf, filename:=filestr & "v" &...
  6. mar050703

    ExportAsFixedFormat

    Sorry for appearing to not understand. Using my second code is there a reason, for which I can not see, why the code is only increasing on version number when I don't close the file. If that makes sense?
  7. mar050703

    ExportAsFixedFormat

    Thank you for your suggestion. If I read your code correctly it appears to save the file as ".txt" and not ".pdf" However I have slightly been able to develop my original code to Sub SavePDF() Static count As Integer Dim filestr As String filestr = "C:\Test" Worksheets("Sheet2").Select If...
  8. mar050703

    ExportAsFixedFormat

    Hi Guys Sorry to bother you all, I have a little problem with some code I am working on. I have an .xlsm file which I ExportAsFixedFormat to pdf, using the following code (this is only test version): Worksheets("Sheet2").Select ActiveSheet.ExportAsFixedFormat Type:=xltypepdf...
  9. mar050703

    Remove Watermark/Shape

    Solved my problem. The issue was that the name was not being defined. Therefore at the bottom of the adding the shape I used: .Name = "Draft" Thanks
  10. mar050703

    Remove Watermark/Shape

    Hi All I am trying to code an excel sheet whereby the code will add a watermark/shape, save the document, and then I need it to remove the watermark/shape. So far I have the following code to add the watermark/shape With ActiveSheet.Shapes.AddTextEffect(msoTextEffect1, "Draft", _...
  11. mar050703

    SaveAs VBA Error

    Thanks Skip Your code is great thanks, however it appears not to keep any cell colours. I have managed to solve my problem (which keeps the formatting) with this code: With ThisWorkbook .Worksheets("Sheet2").Copy Cells.Copy Range("A1").PasteSpecial...
  12. mar050703

    SaveAs VBA Error

    Hi Guys Sorry about this, I have the following code (which works for what I want): Sheets("Sheet2").Copy Cells.Copy Range("A1").PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False ActiveWorkbook.SaveAs "C:\Test.xlsx" ActiveWorkbook.Close This...
  13. mar050703

    SaveAs VBA Error

    Thankyou for your comment. Sorry maybe I was not clear enough. What I am trying to do is in the *.xlsm file (where the macro is) copy Sheet2 as a value only and save it as a *.xls (or *.xlsx) file and then go back to the original *.xlsm file with sheet2 still having the formulas. Is this...
  14. mar050703

    SaveAs VBA Error

    Hello Please can someone help me? What I am trying to do is with the press of a button, copy sheet2 (which has formulas) as values only and then save that sheet as another file. But I need to keep the original sheet with the formulas. My code (all beit test code) is: Sub Button1_Click()...
  15. mar050703

    Combobox listing Sheet Names

    Sorry, Andy's code was perfect. Sub Workbook_Open() Dim s As Worksheet Dim i As Integer For Each s In Worksheets Select Case s.Name Case "April", "May", "June" 'etc Case Else Sheet26.ComboBox1.AddItem s.Name, I i = i + 1 End Select...
  16. mar050703

    Combobox listing Sheet Names

    Thanks, the change of code has worked. Perfect.
  17. mar050703

    Combobox listing Sheet Names

    Thanks Skip I am still getting the same error and the same line is yellow. I have placed the code as follows varSelect.AddItem s.Name, I
  18. mar050703

    Combobox listing Sheet Names

    Thanks Andy Almost there, but sadly when I open the workbook, using that code I get an error message simply saying 'Invalid argument' and the option to debug, when I hit debug, the code: .AddItem s.Name, I is marked as yellow the code I have used is: Sub Workbook_Open() Dim s...
  19. mar050703

    Combobox listing Sheet Names

    Please can someone help? I have the following code in a workbook of about 35 sheets: Sub Workbook_Open() Dim s As Worksheet Dim varSelect Dim i As Integer i = 0 Sheet1.Activate Set varSelect = Sheet26.ComboBox1 With varSelect For Each s In Worksheets...
  20. mar050703

    4 Week Months

    Hello I am trying to work out a formula in excel that can narrow down a 4 week and say 2 day working month into 4 weeks. So if 30th and 31st would be in week 1 of the following month (along with 1,2, and 3rd) therefore Monday 6th would be Week 2. I currently have the following formula...

Part and Inventory Search

Back
Top