LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Macro for checking data in a cell against another cell andcopying/pasting data

I have a workbook with multiple sheets, what I want to do is create a
macro that will check the date in one cell on sheet 1 against the date
on a cell in sheet 2, if they match I want it to copy the data from
F5:F22 on sheet 1 (named current month) and paste to sheet 2 (named
data) in the rows under the cell where the date was found; Example:
May-12 is in column AD, so I want to paste the data into AD3:AD20,
then in June it will shift a column to AE3:20.

Here is where it gets tricky though, I need the macro to also check
the number and see if the meter rolled over (EG. 99999 to 00002) and
if it did I need it to basically adapt that to what it would have been
if it hadn't rolled over (EG. take 99999 and add 00002 to get 100001).
So it will need to take sheet 1 (current month) F5:22 and compare it
to E5:22 and if the number in F5:22 is lower than E5:22 it will need
to add the number from G5:22 to E5:22 and then paste the result of
that. It would also be handy if the macro could annotate the cell with
a note like "rolled over" on it so we can track how fast these meters
roll over.

I have the following formula in cells G5:22 to account for a roll
over:
Code:
=IF(F16<E16,(F16+1000000)-E16,F16-E16)
this allows
the first page to show the proper amount of usage.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Validation - Do not want to allow pasting into the cell MFTiger Excel Programming 3 November 19th 08 07:21 PM
Why does data validation not work when pasting data into a cell. rjshelby Excel Discussion (Misc queries) 1 July 31st 06 09:08 PM
How do I stop cell borders dissappearing when pasting data? John Hallworth Excel Worksheet Functions 2 June 30th 06 08:16 PM
Pasting data top 1st empty cell in range wfcmark Excel Discussion (Misc queries) 4 December 8th 05 10:46 AM
Checking if a cell is filled up with data xpucto Excel Discussion (Misc queries) 1 May 26th 05 10:17 AM


All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"