Cells C11:C45 have pre numeric data.
Cells D11:D45 have post numeric data.
C5 has a date in the following format 2/8/2012 13:30.
Trying to make my macro recognize the date and transpose the pre and post data in another tab in a row with said date in this format 2/8/2012.
Of course the data changes every day so I need my macro to throw the new data in the new row (2/9/12 for example).
Any help is appreciated.
maybe a box of girl scout cookies?
Last edited by ImagineParidise; 02-10-2012 at 02:09 PM. Reason: admin rule violation
Can you upload a sample workbook with no sensitive data showing how the data currently is presented and how you want it to appear - So in a sample sheet give a few examples of how you want the data to be appear after the macro has run. It makes it much easier to supply you an accurate answer if we can see how your workbook is constructed and if we can see an example of how the workbook is to appear after the macro has processed the data. Select Go Advanced, Manage Attachments and select the dummy workbook to upload. Make sure no sensitive/private data is in the workbook you upload. Do not upload screen dumps as no one wants to reconstruct a workbook based on an image.
You will have a much better chance of getting an answer if you could supply a sample workbook.
Hope this helps.
Anthony
Pack my box with five dozen liquor jugs
PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated”
Ok, here we go...I wanted to get my before and after data copied and transposed to a specific date which is in cell C5... The attached workbook is an "After" of what it should look like.
I'm thinking Range.Find but don't know where to start past the excel help associated with this VBA command...
Does this do it?
Option Explicit Sub Do_Data() Dim dDate As Date Dim rBefore As Range, rAfter As Range Dim rSourceBefore As Range, rSourceAfter As Range dDate = Int(Worksheets("Data").Range("C5").Value) Set rBefore = Worksheets("Date Before").Range("A:A").Find(dDate)(1, 2) Set rAfter = Worksheets("Date After").Range("A:A").Find(dDate)(1, 2) Set rSourceBefore = Worksheets("Data").Range("C11:C45") Set rSourceAfter = Worksheets("Data").Range("D11:D45") rSourceBefore.Copy rBefore.PasteSpecial xlPasteAll, xlPasteSpecialOperationNone, , True rSourceAfter.Copy rAfter.PasteSpecial xlPasteAll, xlPasteSpecialOperationNone, , True End Sub
Looks good and works well. Thank you very much! you are now my new best friend ;o
actually, i get a "Run-time error '13': Type mismatch" error with the dDate line when trying to copy it over to another worksheet... any ideas?
Have you checked the contents of the date cell (C5)? It could be text and it may be necessary to force to a date.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks