Hi all,
I have read a few posts similar to what I'm trying to acheive but without anyone actualy seeming to come up with an answer.
The problem I have is :--
Sheet 1 contains all my report data.
I want to strip certain values/cells into a new sheet to for a table.
I want to do this by specifying certain criteria. For example if Cell a1 = "A" then copy cells etc etc
if cell a1 doesn't = "A" then move to the next row etc.
I have this code thus far
Now the problem is that the basics work. Apart from two factors.
1) It continuously loops through the data.
2) It seems to be ignoring the variable PartNm. Even though the particular cell may say columns it is still copying the data.
I would be glad of some help here to help solve these problems. Not far off just need the finishing touches.
Thanks in advance
I have read a few posts similar to what I'm trying to acheive but without anyone actualy seeming to come up with an answer.
The problem I have is :--
Sheet 1 contains all my report data.
I want to strip certain values/cells into a new sheet to for a table.
I want to do this by specifying certain criteria. For example if Cell a1 = "A" then copy cells etc etc
if cell a1 doesn't = "A" then move to the next row etc.
I have this code thus far
Code:
Sub MemberSchedule()
'On Error GoTo Err_MemberSchedule
'check to see if worksheet with foldername exists
Dim FldWS As Worksheet
Dim intCount As Integer
Dim ShtName As String
Dim ShtDate As String
Dim schedSheet As Worksheet
Dim reportSheet As Worksheet
ShtDate = Date
ShtDate = Replace(ShtDate, "/", "")
ShtName = "MemberSchedule " + ShtDate
Worksheets.Add
ActiveSheet.name = ShtName
MsgBox ShtName & " has been added"
Set schedSheet = ActiveSheet
'Format Sheet Style here''''''''''''''''''
Range("A1").Select
ActiveCell.FormulaR1C1 = "Mark"
Range("B1").Select
ActiveCell.FormulaR1C1 = "Section Size"
Range("C1").Select
ActiveCell.FormulaR1C1 = "No. Off"
Range("B:B").Select
Selection.ColumnWidth = 15
Sheets("Report").Select
Set reportSheet = ActiveSheet
Range("i:i").Select
Dim PartNm As String
Dim PartMk As String
Dim SectSize As String
Dim MemCount As Integer
' Look for Beams
PartNm = "Rectangular Beams"
With reportSheet.Range("i2:i500")
Set c = .Find(PartNm, LookIn:=xlValues)
If c Is Nothing Then
MsgBox ("No Beams Found")
Else
Do
PartMk = c.offSet(0, 16).Formula
SectSize = c.offSet(0, 1).Formula
Dim nLastRow As Long
Dim nFirstRow As Long
Dim ncol As Integer
nLastRow = schedSheet.Cells.Find(what:="*", _
searchdirection:=xlPrevious, _
searchorder:=xlRows).row + 1
schedSheet.Range("A" & nLastRow) = PartMk
schedSheet.Range("B" & nLastRow) = SectSize
Set c = .FindNext(c)
Loop While Not c Is Nothing
End If
End With
Exit_MemberSchedule:
Exit Sub
Err_MemberSchedule:
1) It continuously loops through the data.
2) It seems to be ignoring the variable PartNm. Even though the particular cell may say columns it is still copying the data.
I would be glad of some help here to help solve these problems. Not far off just need the finishing touches.
Thanks in advance