Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Taking formula to text

I have a formula which I need to be able to copy/paste to a "Save As" file
name.

Column A Column B
R1 Prod LP10
R2 DivOp1 PUA
R3 14
R4 M
R5 1

Formula is =Prod&"-"&DivOpt1&"-"&B3&B4&B5

The formula returns "LP10-PUA-14M1".

This is supposed to be the name for a file. Yet I cannot copy this result
and paste the name in the "Save As" file name. I've tried Text, T, and a few
others.

Any alternatives to solve this problem?
End result as text is supposed to be "LP10-PUA-14M1"

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Taking formula to text

Put this in Cell E1:
=B1&"-"&B2&"-"&B3&B4&B5

Then run this macro:
Sub SaveSheet()
'error trap
On Error GoTo Etrap

Dim MyCell
MyCell = ActiveCell.Value

'ask user to save
If MsgBox("Save new workbook as " & CurDir & "\" & MyCell & ".xls?",
vbYesNo) = vbNo Then
Exit Sub
End If

'check value of activecell
If MyCell = "" Then
MsgBox "Please check the Cell Value", vbInformation
Exit Sub
End If

'save activeworkbook as new workbook
ActiveWorkbook.SaveAs Filename:=MyCell & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

Etrap:

Beep
Exit Sub

End Sub

Found macro he
http://www.mrexcel.com/archive/VBA/19609d.html


Regards,
Ryan---
--
RyGuy


"Dkline" wrote:

I have a formula which I need to be able to copy/paste to a "Save As" file
name.

Column A Column B
R1 Prod LP10
R2 DivOp1 PUA
R3 14
R4 M
R5 1

Formula is =Prod&"-"&DivOpt1&"-"&B3&B4&B5

The formula returns "LP10-PUA-14M1".

This is supposed to be the name for a file. Yet I cannot copy this result
and paste the name in the "Save As" file name. I've tried Text, T, and a few
others.

Any alternatives to solve this problem?
End result as text is supposed to be "LP10-PUA-14M1"

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Taking formula to text

Thanks for your help. I'm good to go.

"ryguy7272" wrote:

Put this in Cell E1:
=B1&"-"&B2&"-"&B3&B4&B5

Then run this macro:
Sub SaveSheet()
'error trap
On Error GoTo Etrap

Dim MyCell
MyCell = ActiveCell.Value

'ask user to save
If MsgBox("Save new workbook as " & CurDir & "\" & MyCell & ".xls?",
vbYesNo) = vbNo Then
Exit Sub
End If

'check value of activecell
If MyCell = "" Then
MsgBox "Please check the Cell Value", vbInformation
Exit Sub
End If

'save activeworkbook as new workbook
ActiveWorkbook.SaveAs Filename:=MyCell & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

Etrap:

Beep
Exit Sub

End Sub

Found macro he
http://www.mrexcel.com/archive/VBA/19609d.html


Regards,
Ryan---
--
RyGuy


"Dkline" wrote:

I have a formula which I need to be able to copy/paste to a "Save As" file
name.

Column A Column B
R1 Prod LP10
R2 DivOp1 PUA
R3 14
R4 M
R5 1

Formula is =Prod&"-"&DivOpt1&"-"&B3&B4&B5

The formula returns "LP10-PUA-14M1".

This is supposed to be the name for a file. Yet I cannot copy this result
and paste the name in the "Save As" file name. I've tried Text, T, and a few
others.

Any alternatives to solve this problem?
End result as text is supposed to be "LP10-PUA-14M1"

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Taking formula to text

Great! Since that solution solved your problem, please click the 'Yes'
button to let me, and others, know this.

Regards,
Ryan---

--
RyGuy


"Dkline" wrote:

Thanks for your help. I'm good to go.

"ryguy7272" wrote:

Put this in Cell E1:
=B1&"-"&B2&"-"&B3&B4&B5

Then run this macro:
Sub SaveSheet()
'error trap
On Error GoTo Etrap

Dim MyCell
MyCell = ActiveCell.Value

'ask user to save
If MsgBox("Save new workbook as " & CurDir & "\" & MyCell & ".xls?",
vbYesNo) = vbNo Then
Exit Sub
End If

'check value of activecell
If MyCell = "" Then
MsgBox "Please check the Cell Value", vbInformation
Exit Sub
End If

'save activeworkbook as new workbook
ActiveWorkbook.SaveAs Filename:=MyCell & ".xls", _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

Etrap:

Beep
Exit Sub

End Sub

Found macro he
http://www.mrexcel.com/archive/VBA/19609d.html


Regards,
Ryan---
--
RyGuy


"Dkline" wrote:

I have a formula which I need to be able to copy/paste to a "Save As" file
name.

Column A Column B
R1 Prod LP10
R2 DivOp1 PUA
R3 14
R4 M
R5 1

Formula is =Prod&"-"&DivOpt1&"-"&B3&B4&B5

The formula returns "LP10-PUA-14M1".

This is supposed to be the name for a file. Yet I cannot copy this result
and paste the name in the "Save As" file name. I've tried Text, T, and a few
others.

Any alternatives to solve this problem?
End result as text is supposed to be "LP10-PUA-14M1"

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
Autofilter COUNTA formula not taking into account hidden cells Sarah Excel Discussion (Misc queries) 1 August 17th 07 01:17 PM
need help w/ formula for taking lunch & overtime out of a 9 hour jodee501 Excel Discussion (Misc queries) 2 March 31st 07 12:18 AM
taking percentages Zr2x350 Excel Discussion (Misc queries) 6 March 14th 07 10:06 PM
taking two worksheets together Jens Ravens Excel Worksheet Functions 3 June 3rd 06 07:48 AM
how do I stop "copy" taking a picture instead of copying text Martin Gray Excel Discussion (Misc queries) 1 April 6th 06 02:05 PM


All times are GMT +1. The time now is 03:40 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"