Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Visual Basic   »   Excel macro total row

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old Jun 28, 2007, 05:34 AM
ssheldon
New Member
ssheldon is offline
 
Join Date: Jun 2007
Posts: 1
ssheldon See this member's comment history on his/her Profile page.
Excel macro total row

Hello,

I currently have a small problem with a macro in Excel. I am pasting various amounts of rows of information into new workbooks all the time and have created a macro that will sort/tart-up the info. The problem I have is that I wish to attach a 'Total' row after the last line of information (Shown below). Now, the problem I have is that because the information I am pasting into the workbook is a different amount of lines each time, the total line is fixed on the row that the macro was created with, (this is all shown below). I want the macro to be able to distinguish the last row of the information in the workbook and then insert a 'Total' row on the next line down. This is shown below as the total line being stuck on H49:I49 (e.g. the information I pasted in was 48 lines long), so if I was to paste in information that was 100 lines long and played the macro, the total column will still be inserted into the 49th row which is in the centre of the info.


Selection.Borders(xlEdgeRight).Line
Selection.Borders(xlInsideVertical).Line
Range("A49").Select
ActiveWindow.SmallScroll Down:=6
ActiveCell.FormulaR1C1 = "Total"
Range("H49").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-43]C:R[-1]C)"
Range("I49").Select
ActiveCell.FormulaR1C1 = "=SUM(R[-43]C:R[-1]C)"
Range("A49:I49").Select
Selection.Font.Bold = True


Please can you help me out with this. Hopefully I only need to replace the H49 and I49 with a final column command, but as you can see I'm not an expert at macros.

Reply With Quote
 
     



Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
Excel insert row johnmurieldandy Spreadsheets 2 May 17, 2007 04:58 AM
Excel: Macro to designate a color based on condition bhaskar kp Spreadsheets 1 Oct 10, 2006 04:35 AM
Excel Macro question NeedKarma Spreadsheets 0 Jul 5, 2005 10:12 AM
How to Automate a macro in excel traka Spreadsheets 4 Jul 4, 2005 05:09 AM
Inserting a row in Excel Donna_H. Spreadsheets 3 Oct 16, 2004 03:59 PM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 03:16 PM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.