#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Email Sheet

I have the following code as part of a sheet:

Private Sub Worksheet_Activate()
' CHANGES RFI# TO MATCH CURRENT SHEET NAME
Dim JUDD As String
Dim judd5
judd5 = ActiveCell.Address
JUDD = ActiveSheet.Name
Range("K8").Select
ActiveCell.FormulaR1C1 = Right(JUDD, 3)
Range(judd5).Select
End Sub


And I have the following to email the sheet:


Sub Mail_ActiveSheet()
Dim wb As Workbook

Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
' Names the worksheet the same as activesheet
.SaveAs ActiveSheet.Name & ".xls"
' Next line has "" which is a blank email. Allows you to send to whom you
want.
.SendMail "", _
ActiveSheet.Name
' "This is the Subject line" 'Type the subject in the previous quotes
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub



When I use the email macro it always excutes the first code and inserts the
value in the current cell. When this happens it is deleting information that
is needed.

Please help to make this quit.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 341
Default Email Sheet

Judsen, what are you trying to do?
What would you like to see happening? I don't understand enough.
If you don't like that first part, just delete that subroutine. Or change
this line
ActiveCell.FormulaR1C1 = Right(JUDD, 3)

--
Allllen


"Judsen Jones" wrote:

I have the following code as part of a sheet:

Private Sub Worksheet_Activate()
' CHANGES RFI# TO MATCH CURRENT SHEET NAME
Dim JUDD As String
Dim judd5
judd5 = ActiveCell.Address
JUDD = ActiveSheet.Name
Range("K8").Select
ActiveCell.FormulaR1C1 = Right(JUDD, 3)
Range(judd5).Select
End Sub


And I have the following to email the sheet:


Sub Mail_ActiveSheet()
Dim wb As Workbook

Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
' Names the worksheet the same as activesheet
.SaveAs ActiveSheet.Name & ".xls"
' Next line has "" which is a blank email. Allows you to send to whom you
want.
.SendMail "", _
ActiveSheet.Name
' "This is the Subject line" 'Type the subject in the previous quotes
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub



When I use the email macro it always excutes the first code and inserts the
value in the current cell. When this happens it is deleting information that
is needed.

Please help to make this quit.

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Email Sheet

Give this a try...

Sub Mail_ActiveSheet()
Dim wb As Workbook
On Error Goto ErrorHandler
Application.enableevents = false
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
' Names the worksheet the same as activesheet
.SaveAs ActiveSheet.Name & ".xls"
' Next line has "" which is a blank email. Allows you to send to whom you
want.
.SendMail "", _
ActiveSheet.Name
' "This is the Subject line" 'Type the subject in the previous quotes
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
ErrorHandler:
Application.ScreenUpdating = True
Application.enableevents = true
End Sub

--
HTH...

Jim Thomlinson


"Judsen Jones" wrote:

I have the following code as part of a sheet:

Private Sub Worksheet_Activate()
' CHANGES RFI# TO MATCH CURRENT SHEET NAME
Dim JUDD As String
Dim judd5
judd5 = ActiveCell.Address
JUDD = ActiveSheet.Name
Range("K8").Select
ActiveCell.FormulaR1C1 = Right(JUDD, 3)
Range(judd5).Select
End Sub


And I have the following to email the sheet:


Sub Mail_ActiveSheet()
Dim wb As Workbook

Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
' Names the worksheet the same as activesheet
.SaveAs ActiveSheet.Name & ".xls"
' Next line has "" which is a blank email. Allows you to send to whom you
want.
.SendMail "", _
ActiveSheet.Name
' "This is the Subject line" 'Type the subject in the previous quotes
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub



When I use the email macro it always excutes the first code and inserts the
value in the current cell. When this happens it is deleting information that
is needed.

Please help to make this quit.

Thanks in advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Email Sheet

I am using the first routine that links a cell value to the sheet name.

I am then using the second routine to email that sheet.

I want to be able to email the sheet and then have others input data and
email it back.

I can email the workbook if anyone wants it.



"Allllen" wrote:

Judsen, what are you trying to do?
What would you like to see happening? I don't understand enough.
If you don't like that first part, just delete that subroutine. Or change
this line
ActiveCell.FormulaR1C1 = Right(JUDD, 3)

--
Allllen


"Judsen Jones" wrote:

I have the following code as part of a sheet:

Private Sub Worksheet_Activate()
' CHANGES RFI# TO MATCH CURRENT SHEET NAME
Dim JUDD As String
Dim judd5
judd5 = ActiveCell.Address
JUDD = ActiveSheet.Name
Range("K8").Select
ActiveCell.FormulaR1C1 = Right(JUDD, 3)
Range(judd5).Select
End Sub


And I have the following to email the sheet:


Sub Mail_ActiveSheet()
Dim wb As Workbook

Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
' Names the worksheet the same as activesheet
.SaveAs ActiveSheet.Name & ".xls"
' Next line has "" which is a blank email. Allows you to send to whom you
want.
.SendMail "", _
ActiveSheet.Name
' "This is the Subject line" 'Type the subject in the previous quotes
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
End Sub



When I use the email macro it always excutes the first code and inserts the
value in the current cell. When this happens it is deleting information that
is needed.

Please help to make this quit.

Thanks in advance.

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
send email to each customer email in excel sheet. -keevill- Excel Discussion (Misc queries) 3 July 17th 08 02:33 PM
One Sheet by email r4gtl Excel Programming 1 June 5th 06 02:57 PM
eMail a sheet ijb Excel Programming 0 June 8th 04 09:02 PM
eMail a sheet Bob Phillips[_6_] Excel Programming 0 June 8th 04 08:58 PM
eMail a sheet Ron de Bruin Excel Programming 0 June 8th 04 08:40 PM


All times are GMT +1. The time now is 05:02 PM.

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"