Hello,
The code below copies the 1st 5 columns from my Source Worksheet and appends them to a Target Worksheet.
I actually have 2 questions:
1) Once these rows are appended, I need to write out the Day, Month, Month Name, and Year of a date field (in Column 'E') into their own columns (Column 'F' thru Column 'I'). I found this code using a nifty Array, but I can't seem to get it to write the Day/Month/etc. values for just those newly-appended rows in Column 'F' thru Column 'I' (I need to make sure that any rows already present in the Target worksheet are not altered... only the newly-appended rows).
2) What is the proper VBA to obtain the Month Name (in full Name format, e.g. 'December')? The 'MonthName' function doesn't work as I wrote it below.
Thank you!!
![]()
Set src = ThisWorkbook.Worksheets("Webstats_RptList_RawData") Set trg = ThisWorkbook.Worksheets("RptData_Cleaned") With Intersect(src.Range("A:E"), src.UsedRange).Offset(1).Resize(src.UsedRange.Rows.Count - 1) .Copy Destination:=trg.Range("A" & Rows.Count).End(xlUp).Offset(1) '.Delete With trg.Range("E??", trg.Range("E" & Rows.Count).End(xlUp)) With .Columns("F:I") .Formula = Array("=Day(E??)", "=Month(E??)", "=MonthName(E??)", "=Year(E??)") .Value = .Value End With End With End With
Bookmarks