Hi all,
I realize that this has probably been asked a zillion times so if you know of a link I will gladly go to it or if not, help please.
I have a source table that has 5 dates on it. My most current table from the source has these specific dates:
June*2010
May*2010
June*2009
May*2010
June*2009
They are in one row from E3 to I3
I was hoping someone could point in the right VBA way to be able to see them so that I can copy them to our own table. Keep in mind I want this to be a generic find so that when the next update comes out ( and the values change), the code will still work. My idea up until now has been this:
Is there code that can be placed in the "code to find them" spot?for each c in Range("A1:Z250") ....code to find them Selection.Copy ....Paste them to our sheet Next c
Thanks to all that can help!!
Last edited by Mordred; 08-06-2010 at 08:50 PM.
Please leave a message after the beep!
With the help from DonkeyOte from a post he made on another site, this is solved. Sorry about all the documented explanations ( I know most of you don't need them) but it was a straight copy. Next time I see you online DonkeyOte I will hit the scales for you. Thanks.
Dim rng As Range Dim num As Integer ''''This code performs a count in the "Dates" Range to determine the number of cells to be copied'''' num = Worksheets("Insert").Range("Dates").Cells.SpecialCells(xlCellTypeConstants).Count Application.Worksheets("Insert").Select ''''This loop looks for cells that contain values in them and stops/selects the last cell with a '''' ''''value in it.'''' For Each c In Range("Dates") If c.Value <> Empty Then c.Select Next c ''''This code selects all the cells that have values in them and prepares them for a copy.'''' ActiveCell.End(xlToLeft).Resize(, num).Select Selection.Copy
Please leave a message after the beep!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks