Macro help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jotr
    New Member
    • Aug 2008
    • 21

    Macro help

    I don't know where to post my question, so I am sure I will get reprimanded, but I need help with a macro in excel. I currently have a row that is linked to certain cells throughout my workbook, which is constantly changing. What I am trying to do is create a macro that will take that row and copy the data across columns. I currently have it copying the data and transposing it into a column but every time I run the macro it copies down the column instead of going across to the next column. I know very little about macros and what I have I got from a macro someone else wrote with some minor modifications, so I appologize for my ignorance. This is what I have.
    Code:
    Sub Transferdata()
    Sheets("Sheet1").Select
        Range("A20:D20").Select
        Application.CutCopyMode = False
        Selection.Copy
        ActiveWindow.SmallScroll Down:=359
        Range("A60").Select
        Selection.End(xlUp).Select
        ActiveCell.Offset(1, 0).Range("A1").Select
        Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        Application.CutCopyMode = False
        
    End Sub
    Thanks in advance
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    I think those macros are in VB. So lets move this over there.

    Comment

    • jotr
      New Member
      • Aug 2008
      • 21

      #3
      Thank you for moving it. I am sorry I did not post in the correct place.

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        First of all why are you calling a sub macro? may be it is macro, I dont know.

        Can you be more specific where are you doing this. I guess Microsoft excel.

        Make it clear
        where are you doing this(developmen t environment)

        Regards,
        Johny

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Johny,

          Read this: http://office.microsoft.com/en-us/ex...012011033.aspx

          Comment

          • jotr
            New Member
            • Aug 2008
            • 21

            #6
            Yes it is in Microsoft Excel.

            Comment

            • johny10151981
              Top Contributor
              • Jan 2010
              • 1059

              #7
              cool. I like it.

              I just found this link. here. it may be helpful. :) I dont use Microsft Office, so cant check :).

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32656

                #8
                I think this wants to be in Access/VBA. We get a few Excel questions in there and the VB version is more similar.

                I'll see if I can look at this again when I have some time.

                Comment

                • nico5038
                  Recognized Expert Specialist
                  • Nov 2006
                  • 3080

                  #9
                  The "Transpose:=Tru e" parameter is causing the data to be pasted vertically.
                  So that has to be changed from "True" in "False" like "Transpose:=Fal se".

                  Nic;o)

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32656

                    #10
                    Originally posted by jotr
                    I currently have it copying the data and transposing it into a column but every time I run the macro it copies down the column instead of going across to the next column.
                    I suspect you're right Nico. I must admit from the quoted part of the Original Post I rather assumed that the Original Poster appreciated this point. I now doubt they did, so hopefully this will sort the problem for them.

                    Comment

                    Working...