Good evening all and anyone.
Part 1
Attached is my file and on the "Master" page there is a a hidden code ( Shown below ) that "Sintek" created for me last week initially it was to create blocks of data on the " Master " sheet dependent on how rows of data was associated with the Call sign that was entered in cell " C1 " on the " Master " sheet it would create between 1 and 6 blocks of selected data ( NOT ALL CELLS are SELECTED ), however I have now learned that in some cases I could have up to 10 or more rows of data for that call sign.
I have shrunk the panels down and adjusted the font accordingly , so if possible could the code the adjust number of panels up to 10, a sample of the call sign for VK2RAG data is below.
Call Output Input Call mNemonic Location Service Area Latitude Longitude Maidenhead S ERP HASL T/O Sp Tone Notes
VK2RAG 53.7250 52.7250 VK2RAG Someb Somersby Gosford-Wyong -33.360078 151.291215 QG321klm21 O 50 320 3 2EH 91.5 67
VK2RAG 146.7250 146.1250 VK2RAG Someb Somersby Gosford -33.360078 151.291215 O 50 320 3 2EH 91.5
VK2RAG 147.1250 147.7250 VK2RAG Someb1 Somersby Gosford WICEN -33.360078 151.291215 O 50 320 3 2EH 91.5
VK2RAG 438.0750 431.0750 VK2RAG Someb Somersby Gosford - Wyong -33.360078 151.291215 O 50 320 3 2EH 91.5 107
VK2RAG 438.8000 431.8000 VK2RAG Someb1 Somersby Gosford - Wyong -33.360078 151.291215 O 50 320 3 2EH 91.5
VK2RAG 438.8750 431.8750 VK2RAG Someb2 Somersby Gosford - Wyong -33.360078 151.291215 O 25 320 3 2EH 91.5
VK2RAG 439.9500 434.9500 VK2RAG Someb3 Somersby Central Coast -33.360078 151.291215 O - 313 3 2EH 91.5
VK2RAG 1273.4000 1293.4000 VK2RAG Someb Somersby Gosford - 7/18 -33.360078 151.291215 T - 320 - 2EH -
VK2RAG 146.6375 146.0375 VK2RAG C Someb Somersby Gosford (G) -33.360078 151.291215 O 25 320 4 2EH -
VK2RAG 438.3250 432.9250 VK2RAG B Someb1 Somersby Gosford (G) -33.360078 151.291215 O 25 320 4 2EH -
VK2RAG 1273.4000 1293.4000 VK2RAG A Someb2 Somersby Gosford 6/15 -33.360078 151.291215 P 10 320 4 2EH -
VK2RAG 439.9500 434.9500 VK2RAG Someb Somersby Central Coast -33.360078 151.291215 O - 300 3 2EH 91.5 107
Here is the Code that "Sintek" created to fill the blocks as required..
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Arr, cell As Range, rng As Range, Template As Range, ws As String, nxt As Boolean
Dim lr As Long, i As Long, Col As Long, Row As Long, xx As Long, nrs As Long
Set Template = Sheet12.Range("A1:B11")
If Not Intersect(Target, Range("C1")) Is Nothing Then
Set rng = ActiveSheet.Range("C4:C14,F4:F14,I4:I14,L4:L14,C16:C26,F16:F26,I16:I26,L16:L26")
ActiveSheet.Range("A4:A24").EntireRow.Delete
Application.EnableEvents = False
rng.ClearContents: ws = Left(Target, 3): Col = 3: Row = 4
With Sheets(ws)
lr = .Range("A" & Rows.Count).End(xlUp).Row
.Cells(1).CurrentRegion.AutoFilter 4, Target & "*"
nrs = .AutoFilter.Range.Columns(1).SpecialCells(xlCellTypeVisible).Cells.Count - 1
If Not nrs = 0 Then
Set rng = .Range("A2:A" & lr).SpecialCells(12)
For Each cell In rng
Debug.Print cell.Address
Template.Copy ActiveSheet.Cells(Row, Col - 1)
Arr = Array(cell.Offset(, 1), cell.Offset(, 2), cell.Offset(, 5), cell.Offset(, 6), cell.Offset(, 11), _
cell.Offset(, 12), cell.Offset(, 13), cell.Offset(, 15), cell.Offset(, 7), cell.Offset(, 8), cell.Offset(, 9))
For xx = LBound(Arr) To UBound(Arr)
Sheet1.Cells(Row, Col) = Arr(xx): Row = Row + 1
Next xx
Col = Col + 3
If Col = 15 Then
Col = 3: Row = 16: nxt = True
ElseIf nxt = False Then
Row = 4
Else
Row = 16
End If
Next cell
End If
.AutoFilterMode = False
End With
Application.EnableEvents = True
End If
End Sub
If I have not made myself clear enough please advise.
Peter
Bookmarks