Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-19-2011, 04:06 AM
tareq tareq is offline How to use "if" to copy and paste data Windows 7 How to use "if" to copy and paste data Office 2007
Novice
How to use "if" to copy and paste data
 
Join Date: Sep 2010
Posts: 15
tareq is on a distinguished road
Default How to use "if" to copy and paste data

Hi all, this is my second post in this wonderful forum, I am dealing now with another weather data. The format I need is an hourly data for each month, but what I have is a 3-6 hours data, for example i have for the date 1/1/2005 the following hours:


00.00
06.00
09.00
.
.
.

I need the data to be like this:
00.00
01.00
02.00
.
.
.
09.00

So what should be done is copy the data for the (00.00 hour) and paste them twice so I will have (00.00, 01.00 and 02.00) and they all have the same values (the value of the 00.00 hour). After that I have a missing data for hours 03.00, 04.00 and 05.00) so I have to create a row for each hour and fill each cell in those row with (9999). So I need an if statement that can see if the difference between (00.00) and (06.00) is 6 hours it will create (01.00, 02.00) from the (00.00 hour) then it will add rows for (03.00, 04.00 and 05.00) and give each cell in each row a value of (9999), and when the difference is 3 hours it will just copy and past the data of the previous hour, and in my example the difference between (06.00 and 09.00) it will only copy the data of the (06.00 hour) and paste them after it twice so it will create (07.00 and 08.00).
Now another thing, I recorded macros to arrange the original data in the form I want, but since we have months with 30 days and others with 31 and others with 29 or 28 I couldn't add that for the macro, so is there is any way I can edit the macros to make them stop after they face an empty cell??
(Attached is an example for the data I want and a list for the macros I made so someone will help me edit them)
The excel file I attached to this post contains three sheets: "original" which contains the original data, "my macros" which contain the data after I edited them using a recorded macro, and "final" which contain the data in their final format to use in the model and I highlighted the created rows in yellow, and I only put 10 in that sheet just to be brief, but when I will apply the macro I should make the whole days. And the "if" macro I will use it to the "my macros" sheet. Also you will find a list for the macros I recorded to produce the "my macros" sheet from the "original" sheet.
Please guys, I have to finish this by the end of January in order to run the wind erosion model, and I am stuck in this issue only.
Thank you all in advance
Tareq
Attached Files
File Type: xls weatherdata.xls (162.0 KB, 14 views)
File Type: txt macros.txt (32.7 KB, 12 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wierd symbols inplace of "space", "indentation" etc aka.bhagvanji Word 5 02-16-2012 11:50 AM
How to use "if" to copy and paste data Replacing a single "l" with a double "ll" MShroff Word 8 01-19-2011 08:43 AM
"Microsoft Excel Application" missing in the "Component Services" on win08 sword.fish Excel 0 02-26-2010 02:09 PM
How do I change the "and" to "or" with multiple Rules (and Alerts)? bschimmel Outlook 0 11-16-2009 05:26 AM
Saving only "DATA" on excel? No white bottom? jrasche2003@yahoo.com Excel 0 08-07-2006 09:27 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:53 AM.


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