spencerp237
03-09-2017, 12:03 PM
I need a macro that copies that highlighted data to a new worksheet. In sheet 2, columns A (C1) and B (C2) would contain the data in row 2 from sheet 1. Column C (C3) would have the date from column D in sheet 1. Column D (C4) would have the number value that matches columns A:C.
The amount of highlighted rows will constantly be changing so I was thinking about using a For loop. Right now I have this to create a new worksheet for the data to be copied to with the desired headings.
Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Sheet2"
With Sheets("Sheet2")
.Cells(1, 1).Value = "C1"
.Cells(1, 2).Value = "C2"
.Cells(1, 3).Value = "C3"
.Cells(1, 4).Value = "C4"
End With
My first thought for the For loop would be to do something like
For i = 3 To Cells.Highlight = False
However after this I'm not sure how to correctly capture all the data I need to. If everything was in one row that would be easy for me, I just don't know how to properly split up the data.
I've attached a sample workbook with Sheet 2 being the desired output. Any help or tips would be most appreciated https://www.excelforum.com/images/smilies/smile.gif Feel free to ask any questions for clarification.
The amount of highlighted rows will constantly be changing so I was thinking about using a For loop. Right now I have this to create a new worksheet for the data to be copied to with the desired headings.
Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Sheet2"
With Sheets("Sheet2")
.Cells(1, 1).Value = "C1"
.Cells(1, 2).Value = "C2"
.Cells(1, 3).Value = "C3"
.Cells(1, 4).Value = "C4"
End With
My first thought for the For loop would be to do something like
For i = 3 To Cells.Highlight = False
However after this I'm not sure how to correctly capture all the data I need to. If everything was in one row that would be easy for me, I just don't know how to properly split up the data.
I've attached a sample workbook with Sheet 2 being the desired output. Any help or tips would be most appreciated https://www.excelforum.com/images/smilies/smile.gif Feel free to ask any questions for clarification.