ANTONIO1981
Board Regular
- Joined
- Apr 21, 2014
- Messages
- 162
HI All
the result of the of the macro is in tab Capitalisation
Below macro filters the right data in Site_assumptions and arranges into Capitalisation tab
Example
AT2 Krottenbach Jul-71 New sites Nov-17
However i need to add in column F "Engineers" and "Site finders" per site and i don't know how to write that
Hence as an example of site AT2, it has to look like :
AT2 Krottenbach Jul-71 New sites Nov-17 Engineers
AT2 Krottenbach Jul-71 New sites Nov-17 Site finders
I have below code but is only working well for site AT2 , the rest of sites don't add Engineers and site finders
(attached) CAPITALISATION.xlsb - Google Drive
thanks in advance
AC
the result of the of the macro is in tab Capitalisation
Below macro filters the right data in Site_assumptions and arranges into Capitalisation tab
Example
AT2 Krottenbach Jul-71 New sites Nov-17
However i need to add in column F "Engineers" and "Site finders" per site and i don't know how to write that
Hence as an example of site AT2, it has to look like :
AT2 Krottenbach Jul-71 New sites Nov-17 Engineers
AT2 Krottenbach Jul-71 New sites Nov-17 Site finders
I have below code but is only working well for site AT2 , the rest of sites don't add Engineers and site finders
(attached) CAPITALISATION.xlsb - Google Drive
Code:
Sub CAPITALISATION(): Dim r As Long
'Application.ScreenUpdating = False
Sheets("CAPITALISATION").Cells(1).CurrentRegion.Offset(1).ClearContents
'the current region only works if the columns and rows next to it are blank
With Sheets("SITE_ASSUMPTIONS").Range("p9").CurrentRegion
.Parent.AutoFilterMode = False
' colum to filter is 4
'7 is part of the formula is always 7
.AutoFilter 4, Array("Renovation", "New sites"), 7
.Copy Sheets("CAPITALISATION").Cells(1)
.AutoFilter
End With
With Sheets("CAPITALISATION"): r = 2
Do Until .Range("D" & r).Value = ""
If .Range("D" & r).Value = "New sites" Then
.Range("A" & r).Resize(1, 5).Copy: .Rows(r + 1).Insert
.Range("F" & r).Value = "Engineers": r = r + 1
.Range("F" & r).Value = "site finders"
End If: r = r + 1: Loop
End With
Application.CutCopyMode = False
End Sub
[COLOR=#333333]
[/COLOR]
thanks in advance
AC