Consulting

Results 1 to 2 of 2

Thread: Using macro to import stock symbol

  1. #1

    Using macro to import stock symbol

    I am using a record macro to import date from a financial web site. I am getting an error message on the ACTIVE SHEET PASTE. fuction.
    Listed below is he macro. I am stuck.
    Sub Macro1()
    ' Macro1 Macro
    Range("A1").Select
    Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
    Range("A4").Select
    Selection.Copy
    Application.CutCopyMode = False
    Range("B4").Select
    ActiveSheet.Paste
    With Selection.Font
     .Name = "Arial"
     .Size = 10
     .Strikethrough = False
     .Superscript = False
     .Subscript = False
     .OutlineFont = False
     .Shadow = False
     .Underline = xlUnderlineStyleNone
     .Color = -16777216
     .TintAndShade = 0
     .ThemeFont = xlThemeFontNone
     End With
     Range("A5").Select
     Selection.Copy
     Application.CutCopyMode = False
     Range("B5").Select
     ActiveSheet.Paste
     With Selection.Font
     .Name = "Arial"
     .Size = 10
     .Strikethrough = False
     .Superscript = False
     .Subscript = False
     .OutlineFont = False
     .Shadow = False
     .Underline = xlUnderlineStyleNone
     .Color = -16777216
     .TintAndShade = 0
     .ThemeFont = xlThemeFontNone
     End With
    Range("A6").Select
    End Sub
    Last edited by Aussiebear; 11-03-2013 at 06:56 PM. Reason: Added code tags to supplied code

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Same Sub cleaned up.

    Sub Macro1() 
         ' Macro1 Macro
        Range("A1").Select 
        Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True 
        Range("A4:A5").Copy Range("B4")
        With Range("B4:B5").Font 
            .Name = "Arial" 
            .Size = 10 
            '.Color = -16777216 'This color constant does not exists in Excel 2002
        End With 
        Range("A6").Select 
    End Sub
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •