PC Review


Reply
Thread Tools Rate Thread

Change Formula's to Values

 
 
Steved
Guest
Posts: n/a
 
      9th Jan 2008
Hello from Steved

Please how to I put in the below "Change Formula's to Values"

Sub Consolidated()
'Working in 97-2007
Dim wb As Workbook
Dim Shname As Variant
Dim Addr As Variant
Dim N As Integer
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
Dim FileFormatNum As Long

Shname = Array("Summary Report")
Addr = Array("A-Consolidated_Report")

If Val(Application.Version) >= 12 Then
'You run Excel 2007
FileExtStr = ".xls": FileFormatNum = 56
Else
'You run Excel 97-2003
FileExtStr = ".xls": FileFormatNum = -4143
End If

With Application
.ScreenUpdating = False
.EnableEvents = False
End With

TempFilePath = Environ$("temp") & "\"

'Create the new workbooks/Mail it/Delete it
For N = LBound(Shname) To UBound(Shname)

TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
h-mm-ss")

ThisWorkbook.Sheets(Shname(N)).Copy
Set wb = ActiveWorkbook

With wb
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
On Error Resume Next
.SendMail Addr(N), _
"Consolidated Report"
On Error Resume Next
.Close SaveChanges:=False
End With

Kill TempFilePath & TempFileName & FileExtStr

Next N

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub

Thankyou.
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      9th Jan 2008
With wb.Worksheets(1).Cells
.Value = .Value
End With

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Steved" <(E-Mail Removed)> wrote in message
news:49E5EF0C-0FA3-4A7D-A7F4-(E-Mail Removed)...
> Hello from Steved
>
> Please how to I put in the below "Change Formula's to Values"
>
> Sub Consolidated()
> 'Working in 97-2007
> Dim wb As Workbook
> Dim Shname As Variant
> Dim Addr As Variant
> Dim N As Integer
> Dim TempFilePath As String
> Dim TempFileName As String
> Dim FileExtStr As String
> Dim FileFormatNum As Long
>
> Shname = Array("Summary Report")
> Addr = Array("A-Consolidated_Report")
>
> If Val(Application.Version) >= 12 Then
> 'You run Excel 2007
> FileExtStr = ".xls": FileFormatNum = 56
> Else
> 'You run Excel 97-2003
> FileExtStr = ".xls": FileFormatNum = -4143
> End If
>
> With Application
> .ScreenUpdating = False
> .EnableEvents = False
> End With
>
> TempFilePath = Environ$("temp") & "\"
>
> 'Create the new workbooks/Mail it/Delete it
> For N = LBound(Shname) To UBound(Shname)
>
> TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
> h-mm-ss")
>
> ThisWorkbook.Sheets(Shname(N)).Copy
> Set wb = ActiveWorkbook
>
> With wb
> .SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
> On Error Resume Next
> .SendMail Addr(N), _
> "Consolidated Report"
> On Error Resume Next
> .Close SaveChanges:=False
> End With
>
> Kill TempFilePath & TempFileName & FileExtStr
>
> Next N
>
> With Application
> .ScreenUpdating = True
> .EnableEvents = True
> End With
> End Sub
>
> Thankyou.



 
Reply With Quote
 
Steved
Guest
Posts: n/a
 
      10th Jan 2008
Hello Bob

Thanyou just what I required.

Steved

"Bob Phillips" wrote:

> With wb.Worksheets(1).Cells
> .Value = .Value
> End With
>
> --
> HTH
>
> Bob
>
> (there's no email, no snail mail, but somewhere should be gmail in my addy)
>
> "Steved" <(E-Mail Removed)> wrote in message
> news:49E5EF0C-0FA3-4A7D-A7F4-(E-Mail Removed)...
> > Hello from Steved
> >
> > Please how to I put in the below "Change Formula's to Values"
> >
> > Sub Consolidated()
> > 'Working in 97-2007
> > Dim wb As Workbook
> > Dim Shname As Variant
> > Dim Addr As Variant
> > Dim N As Integer
> > Dim TempFilePath As String
> > Dim TempFileName As String
> > Dim FileExtStr As String
> > Dim FileFormatNum As Long
> >
> > Shname = Array("Summary Report")
> > Addr = Array("A-Consolidated_Report")
> >
> > If Val(Application.Version) >= 12 Then
> > 'You run Excel 2007
> > FileExtStr = ".xls": FileFormatNum = 56
> > Else
> > 'You run Excel 97-2003
> > FileExtStr = ".xls": FileFormatNum = -4143
> > End If
> >
> > With Application
> > .ScreenUpdating = False
> > .EnableEvents = False
> > End With
> >
> > TempFilePath = Environ$("temp") & "\"
> >
> > 'Create the new workbooks/Mail it/Delete it
> > For N = LBound(Shname) To UBound(Shname)
> >
> > TempFileName = "Sheet " & Shname(N) & " " & Format(Now, "dd-mmm-yy
> > h-mm-ss")
> >
> > ThisWorkbook.Sheets(Shname(N)).Copy
> > Set wb = ActiveWorkbook
> >
> > With wb
> > .SaveAs TempFilePath & TempFileName & FileExtStr, FileFormatNum
> > On Error Resume Next
> > .SendMail Addr(N), _
> > "Consolidated Report"
> > On Error Resume Next
> > .Close SaveChanges:=False
> > End With
> >
> > Kill TempFilePath & TempFileName & FileExtStr
> >
> > Next N
> >
> > With Application
> > .ScreenUpdating = True
> > .EnableEvents = True
> > End With
> > End Sub
> >
> > Thankyou.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
assigning values to one cell which will change the formula in anot =?Utf-8?B?RGFycmVu?= Microsoft Excel Worksheet Functions 1 26th Jul 2007 10:06 AM
Need to change existing formula into values... =?Utf-8?B?U3JpcmFt?= Microsoft Excel Programming 1 19th May 2006 04:28 PM
how to change values to formula in VBA to carry out goal seek? =?Utf-8?B?RGVzbW9uZA==?= Microsoft Excel Programming 0 18th Jan 2006 12:29 PM
WHEN EDITING VALUES IN A FORMULA, IT DOESN'T CHANGE TOTALS =?Utf-8?B?QVJJRUw=?= Microsoft Excel Worksheet Functions 1 29th Jun 2005 11:14 PM
Formula to change calculated results to values =?Utf-8?B?Q2FtZXJvbg==?= Microsoft Excel Worksheet Functions 4 24th Jan 2005 08:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 PM.