View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
William Benson[_2_] William Benson[_2_] is offline
external usenet poster
 
Posts: 230
Default Saving input figures.

I think what you may be looking for Glenn is this -- it is just a model of
what you can do in the BeforeSave event in the ThisWorkbook code Module:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As _
Boolean, Cancel As Boolean)
Dim i As Long
Dim MyRange As Range
Dim MyNameIs As String

'Procedure here to harvest the data into a range
'For example, suppose there are
'Data in Rows 1 through 10

On Error GoTo err_Handler
For i = 1 To 10
If MyRange Is Nothing Then
Set MyRange = Cells(i, 1).EntireRow
Else
Set MyRange = Union(MyRange, Cells(i, 1).EntireRow)
End If
Next i

'Create the workbook to actually save
With Workbooks.Add
MyRange.Copy Destination:=Range("A1")
MyNameIs = InputBox("What shall we name this workbook " & _
"it cannot be: " & vbCr & _
ThisWorkbook.Path & "\" & _
ThisWorkbook.Name, _
"Saving to a new File", ThisWorkbook.Path & "\NewName.Xls")
.SaveAs (MyNameIs)
End With

Exit_Me:
Exit Sub

err_Handler:
MsgBox Err.Description
Resume Exit_Me

End Sub



"glenn" wrote in message
...
I have built this program. Is there a way u I can save the imputed
information and not the entire templete used. Also when i want to click
on
this saved info will it load it into the templete?
THANKS GLENN