+ Reply to Thread
Results 1 to 20 of 20

using macros across a sheet

  1. #1
    Registered User
    Join Date
    02-03-2008
    Posts
    12

    using macros across a sheet

    Hi all,
    how do I use a macro across a spreadsheet?I can record a macro OK,but when I try to use it again on the same spreadsheet all I get is the macro calculating using the same data as when I recorded it.I have several groups of data across one spreadsheet and I want to use the same macro over the entire sheet.How do I do this?Thanks in advance,
    Dave

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Please read forum rules below. I've move your post to programming

    If you add your code use
    Please Login or Register  to view this content.
    as per example and someone will take a look

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    02-03-2008
    Posts
    12

    using macros

    Hi all,
    how do I use a macro across a spreadsheet?I can record a macro OK,but when I try to use it again on the same spreadsheet all I get is the macro calculating using the same data as when I recorded it.I have several groups of data across one spreadsheet and I want to use the same macro over the entire sheet.How do I do this?Thanks in advance,
    Dave

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    daveyboy123,

    Please read forum rules and message to cross posters below and then add a link to your cross post

    Also your duplicate posts have being merged

    VBA Noob

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I think this is the same question

    http://www.excelforum.com/showthread.php?t=631931
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    Ok,here is the workbook.Hopefully someone can help!Pleas keep in mind I am a complete noob with Excel!
    Attached Files Attached Files

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645
    Nice workbook - shame there's no code in it.

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    There's nothing to indicate what you are averaging.

  9. #9
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    Sorry all,as I said I am new to all this!I need the averages across all the %age rows for every compartment(A1,A2,A3 etc)Here it is again,this time if you look at A1(column 18) I have worked out the averages across all the rows....I need a simple macro that will do this for me over the whole sheet.I have very little of experience of Excel,but I can get a macro to work for one compartment.
    Attached Files Attached Files

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I can't see why you need a macro to do this.

    Why not set up a sheet for each compartment? If you did you could have a template sheet with all the formatting & calculations in ready to use.

  11. #11
    Registered User
    Join Date
    02-03-2008
    Posts
    12

    Unhappy

    That would seem to be a good idea mate.Trouble is I have know idea how to set up a template that could be used in that way.

  12. #12
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Quote Originally Posted by daveyboy123
    That would seem to be a good idea mate.Trouble is I have know idea how to set up a template that could be used in that way.
    You just set up one sheet formatted how you want it to look, then add all the formulas that you need. Then ximply copy the sheet for each compartment, adding the relevant data.

  13. #13
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    Cheers for your help Roy.I understand what you are saying,but how do I set the calculations into the template?I probably sound completely thick....but as I said I have not used Excel much before.The actual data entry has been fine,and I have created graphs and calculated coefficients without many problems.Its just that with this sort of software if you dont know what you are doing its very hard to just stumble onto the solution.....it takes a while to even learn the correct terminology to use when asking questions!

  14. #14
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    daveyboy123,

    Add the link to the cross post as requested or thread will be locked

    VBA Noob

  15. #15
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    Here is the link to the cross post...
    http://www.excelforum.com/showthread.php?t=631931

  16. #16
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    My initial question has been solved here
    http://www.mrexcel.com/forum/showthread.php?t=301445

    But I would still like to know how to set the calculations into a template,if you dont mind Roy.

  17. #17
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    If you had included the code in your workbook you might have had a solution here sooner. I'll look at your template needs later.

  18. #18
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    I realise I should have included the code earlier,but I didnt know how to find it then!Thanks for your continuing help Roy.Cheers,
    Dave

  19. #19
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    There's an example of using a sheet as a template - Summary sheet - here

    http://www.excel-it.com/workbook_downloads.htm

  20. #20
    Registered User
    Join Date
    02-03-2008
    Posts
    12
    Thanks a lot for your help Roy,my problems have been solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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