+ Reply to Thread
Results 1 to 8 of 8

Macro goes to A1 automatically

  1. #1
    Registered User
    Join Date
    03-23-2015
    Location
    Berlin, Germany
    MS-Off Ver
    Office 2010
    Posts
    5

    Macro goes to A1 automatically

    Hello guys,

    why does this macro go to the cell A1 automatically and gives me this table:

    Please Login or Register  to view this content.

    tar.PNG

    I appreciate your answer!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro goes to A1 automatically

    When I run the code on a blank sheet the selected cell stays where it was and I get a table of 0s.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro goes to A1 automatically

    You are asking, with the macro to start filling cells(2,2) ( which is B2) and then to scroll by rows and by columns
    Certainly first column and first row have already some values , is it?
    - Battle without fear gives no glory - Just try

  4. #4
    Registered User
    Join Date
    03-23-2015
    Location
    Berlin, Germany
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Macro goes to A1 automatically

    @Nori
    Like that I guess:

    zero.PNG

    My question is probably quite newbish. What I do not get is, why are always the cells in the upper left corner selected with values?

    Thx in advance for your reply!

  5. #5
    Registered User
    Join Date
    03-23-2015
    Location
    Berlin, Germany
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Macro goes to A1 automatically

    Quote Originally Posted by PCI View Post
    You are asking, with the macro to start filling cells(2,2) ( which is B2) and then to scroll by rows and by columns
    Certainly first column and first row have already some values , is it?
    Thx for your answer! I do not get why only these cells get filled and not others?(even when I have no values in it)

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro goes to A1 automatically

    pisco

    The code you posted doesn't select anything.

    It loops from B2 (Cells(2,2)) across to F2 (Cells(2,6)) then goes down to B3 (Cells(3,2)) and across to F3(Cells(3,6)) and so on.

    As it goes it multiplies the value from row 1 in the corresponding column with the value from column A in the corresponding row.

    This might show you what's being multiplied.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    03-23-2015
    Location
    Berlin, Germany
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Macro goes to A1 automatically

    Thx for your answer! I get it now!

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro goes to A1 automatically

    You could also go step by step in the macro using key F8 and see what's happening in the sheet

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to export and import a module and assigning different macro automatically
    By Libster78 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-14-2015, 06:31 PM
  2. Replies: 0
    Last Post: 01-15-2013, 08:18 PM
  3. Assign a macro to automatically find the last assigned other macro
    By tperkins1973 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2012, 06:39 PM
  4. Automatically activate macro when data is inputed instead of manually activating macro
    By sonny.thind in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-12-2012, 08:45 AM
  5. Replies: 3
    Last Post: 08-11-2008, 09:21 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1