Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 04-23-2012, 01:30 PM
cjaye cjaye is offline Display history for spreadsheet data Windows XP Display history for spreadsheet data Office 2007
Novice
Display history for spreadsheet data
 
Join Date: Mar 2012
Posts: 6
cjaye is on a distinguished road
Default

Thanks for the reply macropod. I'm currently working on (struggling) some vba code to copy previous mileage to a history sheet for each month, however, I think I may consider your suggestion of putting the formulas on another sheet... I might then be able to insert/hide the history columns on the data sheet (the user's preference)..since inserting columns which would push data & formulas over would not be an issue if the formulas were on a different sheet.

Here's my current vba code
Code:
  'Prior to the Previous Mileage column on the Main sheet being updated with the Current Mileage column (performed once at beginning of month),
   'this section copies the Previous Mileage to the Mileage History sheet to add to the mileage history
   'which helps Deanna better track/manage the mileages.
  
   'Holds last month/year (ex. December, 2011) for Mileage History sheet column heading
    LDate = (MonthName(DatePart("m", CurDate - 30))) & ", " & DatePart("yyyy", CurDate)
  
    Lc = Lastcol(Sheets("Mileage History")) + 1      'finds the first empty column on the Mileage History sheet
    Set sourceRange = Sheets("Main").Columns("C:C")  'sets Main.previous mileage column range
    Set destrange = Sheets("Mileage History").Columns(Lc) 'sets Mileage History column range to copy prev mileage to
    sourceRange.Copy destrange  'copy prev mileage
    
   'Adds a column heading of previous month, year, centers expands column width
    With destrange.Range("A1")
      .Value = LDate
      .HorizontalAlignment = xlCenter
      .ColumnWidth = 11
    End With
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying cell data in another spreadsheet Colonel Biggs Excel 0 07-01-2010 07:37 PM
Client Payment History GMatos78 Office 0 04-22-2010 03:40 PM
Display history for spreadsheet data Data Set Display Size - PP 2007 TonyMan PowerPoint 1 04-14-2010 05:45 AM
Displaying data from spreadsheet in Userform darklide Excel 0 03-12-2010 05:42 AM
CAUTION!! Sorting a spreadsheet with hidden columns will trash your data. psmaster@earthlink.net Excel 0 11-24-2009 11:54 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:30 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft