FantasticJac
09-24-2007, 06:35 AM
Hey All,
I've only been messing around with VBA for a few days now after finding out how helpful it can be when working with mass quantities of data in excel. I'm currently stuck and can't find an answer. Any help would be greatly appreciated. I feel like it's probably so easy I'm just looking past it, but I've been trying for two days.... Here's my problem.
I'm pasting a chunk of data into excel from an outside program. I've already got the macro I'm creating cutting and pasting the chunk into a string of useable data, but I need to add to the already existing text in one of the fields that I cut and paste. Is there a variable I can put in in place of the red text so it just tacks what I want onto the end of the string? Or is there a formula?... What I've got is below. The text in red will be different every time... all I want to do is add the ".pwf" to whatever text is in that field. Any ideas would be GREATLY appreciated!
Sub test6()
'
' test6 Macro
' Macro recorded 9/24/2007 by ebenm
'
' Keyboard Shortcut: Ctrl+k
'
ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
False
ActiveCell.Offset(2, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(-2, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
ActiveCell.FormulaR1C1 = _
"TXWEBB_FP525 C3 43-4600 WE Ser1_3 Agua Azul 600 1.pwf"
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(3, -1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(-3, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -1).Range("A1:B3").Select
Selection.ClearContents
ActiveCell.Select
End Sub
I've only been messing around with VBA for a few days now after finding out how helpful it can be when working with mass quantities of data in excel. I'm currently stuck and can't find an answer. Any help would be greatly appreciated. I feel like it's probably so easy I'm just looking past it, but I've been trying for two days.... Here's my problem.
I'm pasting a chunk of data into excel from an outside program. I've already got the macro I'm creating cutting and pasting the chunk into a string of useable data, but I need to add to the already existing text in one of the fields that I cut and paste. Is there a variable I can put in in place of the red text so it just tacks what I want onto the end of the string? Or is there a formula?... What I've got is below. The text in red will be different every time... all I want to do is add the ".pwf" to whatever text is in that field. Any ideas would be GREATLY appreciated!
Sub test6()
'
' test6 Macro
' Macro recorded 9/24/2007 by ebenm
'
' Keyboard Shortcut: Ctrl+k
'
ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
False
ActiveCell.Offset(2, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(-2, -1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Select
ActiveCell.FormulaR1C1 = _
"TXWEBB_FP525 C3 43-4600 WE Ser1_3 Agua Azul 600 1.pwf"
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(3, -1).Range("A1").Select
Selection.Cut
ActiveCell.Offset(-3, 0).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, -1).Range("A1:B3").Select
Selection.ClearContents
ActiveCell.Select
End Sub