+ Reply to Thread
Results 1 to 3 of 3

Save Worksheet as workbook (Format .xlsm)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Save Worksheet as workbook (Format .xlsm)

    Good day,
    I am looking for two codes, one I am almost done with and I will figure that one out. My second most challenging one would be a synopsis as follows:

    I have a code telling me if anything in my active cell is higher than 1 mil to open a UserForm so that information can be provided to this form.

    Once that form is complete I need the system to search in a specific directory if my Userform’s Label15.value and Label14.value making the following code, if it exist:
    Label15.value & “ “ & Label14.value

    I have a hidden sheet that will have the information from this Userform by copying what I need and pasting the information on a particular row (row4) in this sheet.

    If the name already exist it need to grab the information from my original workbook on, let’s say Sheets(“sheet1”). Range(“A4:H4”) and copy the information on the next available row in my new open workbook, then save close.

    IF it doesn’t not exist then go in this directory, create a new workbook based on my Sheets(“sheet1”) (Everything in this sheet) and save the content as my Label15.value & “ “ & Label14.value and save as .xlsm then close this workbook, go back to my original workbook and erase everything on row 4 from my Sheets(“sheet1”).

    Dir: C:\Users\Desktop\

    Hope someone can get me started.

    Thank you so much,

    Excel Noub
    Click the star icon in the lower left part of the contributor's post and add Reputation if we have helped you .

  2. #2
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Save Worksheet as workbook (Format .xlsm)

    I have completed my code for opening if the code finds the right info:

    Dim strRootPath As String, strSubFolder As String, strToOpen As String
    Dim strUser As String, strReqNo As String, strPath As String, strFile As String
    
    Sub findfolder()
    
        strRootPath = "My path here"
        strUser = "Text "
        strReqNo = Range("A" & ActiveCell.row)
        
        If strReqNo Like "*/[A-Z]" Then strReqNo = left(strReqNo, Len(strReqNo) - 2)
        
        strPath = strRootPath & strUser & strReqNo & ".xls"
        strFile = strUser & strReqNo
    
        If Dir(strPath) <> "" Then
            Workbooks.Open strPath
        Else
            MsgBox strFile & " Not Found "
        End If
    
    End Sub

  3. #3
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Re: Save Worksheet as workbook (Format .xlsm)

    I have found an alternate method for my process

    Thank you for trying

    ExcelNoub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Save as cell name in xlsm format
    By cbatten01 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 10-29-2014, 02:52 PM
  2. [SOLVED] save as xlsm workbook
    By joee74 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-14-2014, 01:07 PM
  3. copy worksheet to new workbook and save as .xlsm
    By wee_bittie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2014, 11:55 AM
  4. [SOLVED] Copy/Save As xlsm workbook to new xlsm workbook is not copying the code with it
    By Grinchy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-02-2013, 09:30 AM
  5. Save file xls file as xlsm - macro won't run in xlsm workbook
    By captbluefin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-07-2012, 11:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1