sodonnell44
New Member
- Joined
- Mar 28, 2011
- Messages
- 8
I'm putting data off the internet and refreshing it in real time. The problem I'm going to run into is that occasionally the website I'm pulling from will but unwanted characters in a certain cell so I was going to use a macro to circumvent this if it happens by doing a little copy, text to columns, replace b/c I'm also using vlookup to organize all if it. In any case, I want to be able to execute the macro on Sheet4 while remaining on Sheet1. Listed below is the macro. Any help would be greatly appreciated. Thanks
Sub Macro3()
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+m
'
Sheet4.Range("E91").Select
Selection.Copy
Sheet4.Range("P78").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Sheet4.Range("P78"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Sheet4.Rows("91:91").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheet4.Range("P78").Select
Selection.Copy
Sheet4.Range("E91").Select
ActiveSheet.Paste
Sheet4.Range("F92:M92").Select
Application.CutCopyMode = False
Selection.Copy
Sheet4.Range("F91").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Sheet4.Rows("92:92").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub
Sub Macro3()
' Macro3 Macro
'
' Keyboard Shortcut: Ctrl+m
'
Sheet4.Range("E91").Select
Selection.Copy
Sheet4.Range("P78").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.TextToColumns Destination:=Sheet4.Range("P78"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Sheet4.Rows("91:91").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheet4.Range("P78").Select
Selection.Copy
Sheet4.Range("E91").Select
ActiveSheet.Paste
Sheet4.Range("F92:M92").Select
Application.CutCopyMode = False
Selection.Copy
Sheet4.Range("F91").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Sheet4.Rows("92:92").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlUp
End Sub