[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Dim sws As Worksheet, dws As Worksheet
Dim lr1 As Long, lc As Long, lr2 As Long, dlr As Long
Dim rng As Range, rngList As Range, cell As Range
Application.ScreenUpdating = False
Set sws = Sheets("List")
lr1 = sws.Cells(Rows.Count, 2).End(xlUp).Row
lr2 = sws.Cells(Rows.Count, 4).End(xlUp).Row
lc = sws.Cells(3, Columns.Count).End(xlToLeft).Column
Set rng = sws.Range(sws.Cells(4, 4), sws.Cells(lr2, lc))
Set rngList = sws.Range("B4:B" & lr1)
On Error Resume Next
Set dws = Sheets("Master")
On Error GoTo 0
If dws Is Nothing Then
Set dws = Sheets.Add(after:=sws)
dws.Name = "Master"
sws.Range("D3", sws.Range("D3").End(xlToRight)).Copy dws.Range("B1")
dws.Range("A1").Value = "Name"
For Each cell In rngList
dlr = dws.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
rng.Copy dws.Range("B" & dlr)
dws.Range("A" & dlr).Value = cell.Value
dlr = dws.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
dws.Range("A2:A" & dlr).SpecialCells(xlCellTypeBlanks).Formula = "=R[-1]C"
dws.Range("A2:A" & dlr).Value = dws.Range("A2:A" & dlr).Value
dws.Range("A1").CurrentRegion.Borders.Color = vbBlack
Application.ScreenUpdating = True
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.