Save Code not working

buzz71023

Active Member
Joined
May 29, 2011
Messages
295
Office Version
  1. 2016
Platform
  1. Windows
I have this code that is suppose to go to a directory and allow a user to define the file name and save in that directory. The only problem is, the code do not give an error of any kind and after you attempt to save and follow the path to where the file should be it is not there. I may have it totally wrong. Sorry for the lack of spaces, the forum is not letting me use "Enter"/"Return".
Code:
 Dim I As Long
Dim RNG As Range
Set RNG = Sheets("CAF").Range("ag44")
     
 For I = 1 To 7
 
If Me.Controls("CheckBox" & I).Value Then
RNG.Value = Me.Controls("CheckBox" & I).Caption
Set RNG = RNG.Offset(1)
End If
Next I
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("CAF")
Unload Me
'Print is next step
Dim sh As Worksheet
Set sh = ActiveSheet
Worksheets(Array("Printed CAF")).PrintOut
sh.Select
' ask user to save if they need to kclay
Response = MsgBox("Would you like to save this form before exiting? If so, save as Lot Number In initiated CAF folder on shared", vbYesNoCancel + vbCritical + vbDefaultButton2)
If Response = vbCancel Then
Exit Sub
ElseIf Response = vbNo Then
Exit Sub
ElseIf Response = vbYes Then
Dim Fs As String
ChDir "P:\Lab Folder\Corrective Action Archives"
Fs = Application.GetSaveAsFilename(fileFilter:="Microsoft Excel File (*.xls), *.xls")
If Fs = "False" Then
End If
End If
End Sub
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top