Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Autofilter COUNTA formula not taking into account hidden cells | Excel Discussion (Misc queries) | |||
need help w/ formula for taking lunch & overtime out of a 9 hour | Excel Discussion (Misc queries) | |||
taking percentages | Excel Discussion (Misc queries) | |||
taking two worksheets together | Excel Worksheet Functions | |||
how do I stop "copy" taking a picture instead of copying text | Excel Discussion (Misc queries) |