Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Save As Macro

I am a macro to do a save as.

Code

Sub savesheet()


Application.ScreenUpdating = True
Dim wb As Workbook
Application.ScreenUpdating = False
ActiveSheet.Copy

Set wb = ActiveWorkbook
Application.ScreenUpdating = True
sFilename = "C:\TimeSheet\" & Format(Range("h12").Value,
"mm-dd-yy Job# " & ActiveSheet.Range("h2").Value & " " &
Range("b6").Value)
ans = MsgBox("Save file as " & sFilename)

If ans = vbOK Then
With wb

ActiveSheet.Shapes("Button 2").Select
Selection.Delete

.SaveAs sFilename
.Close False
End With
Application.ScreenUpdating = True
End If
End Sub


Cell "h12" is a date
Cell "h2" is a 6 digit #
Cell "b6" is my name


The problem is with my name. Brian Arnold. When I run the macro my
name comes back "Bria0 Ar0ol1"

Please Help

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Save As Macro


Try changing the last .value to .formula.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Save As Macro

You have the closing bracket in the wrong place

sFilename = "C:\TimeSheet\" & _
Format(Range("h12").Value, "mm-dd-yy Job# ") & _
ActiveSheet.Range("h2").Value & " " & _
Range("b6").Value


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ward376" wrote in message
oups.com...

Try changing the last .value to .formula.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Save As Macro

Thanks Bob it worked great



Bob Phillips wrote:
You have the closing bracket in the wrong place

sFilename = "C:\TimeSheet\" & _
Format(Range("h12").Value, "mm-dd-yy Job# ") & _
ActiveSheet.Range("h2").Value & " " & _
Range("b6").Value


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ward376" wrote in message
oups.com...

Try changing the last .value to .formula.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
Macro (SAVE AS) Tom Excel Discussion (Misc queries) 1 September 26th 07 02:41 PM
Macro to Save without the Save Message Ellen G Excel Discussion (Misc queries) 4 February 23rd 07 08:52 PM
ASP: Open Excel File with Macro, Allow Macro to run, and then save delgados129 Excel Programming 0 March 10th 05 09:35 PM
Prompted to save changes after macro save - why? Izar Arcturus Excel Programming 2 December 10th 03 09:27 PM


All times are GMT +1. The time now is 10:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"