I've adjusted the macro so that it will now copy all the data down to however many categories you add in column E. Expand them as you wish and the macro will include them.
Also borders are not copied now.
Also, a Data validation list is used in F6 to insure the correct model # spellings are used since even a tiny misspelling like an unseen space would cause the macro to crash. Best to validate that cell.
Option Explicit
Sub TransferData()
'JBeaucaire (12/18/2009)
Dim RNG As Range, ws As Worksheet, LR As Long
Application.ScreenUpdating = False
LR = Range("E" & Rows.Count).End(xlUp).Row
Set RNG = Range("F5:F" & LR)
If WorksheetFunction.CountA(RNG) < LR - 5 Then
MsgBox "Please fill in all " & LR - 5 & " values"
Exit Sub
Else
Set ws = Sheets("Model " & Range("F6"))
RNG.Copy
ws.Cells(5, Columns.Count).End(xlToLeft).Offset(0, 1).PasteSpecial xlPasteValuesAndNumberFormats
RNG.ClearContents
[F5].Select
End If
Application.ScreenUpdating = True
End Sub
============
If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
(Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)
Bookmarks