I am not sure what that means, what causes that, or how to fix it?
When i run my macro, it gives the the "subscript out of range" error!
can anyone help me?
Code:
Sub PnP_Column1_CountRmax()
' Defines Rmax as a range
Dim Rmax As Range
' Scans (x,1) for the value of 100
Set Rmax = Range("A:A").Find("100", , xlValues, xlPart)
Call PnP_Column1_FindSemiColon
End Sub
Public Sub PnP_Column1_FindSemiColon()
' Scans all rows in column 1 for a semicolon (;) and if found, copies that entire row to a seperate workbook.
Dim rng As Range
Dim LastRow As Long
Dim oWB As Workbook
With ActiveSheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Set oWB = Workbooks.Add
Set rng = .Range("A1").Resize(LastRow)
rng.AutoFilter field:=1, Criteria1:="=;*", Operator:=xlOr, Criteria2:=25
rng.SpecialCells(xlCellTypeVisible).EntireRow.Copy oWB.Worksheets(1).Range("A1")
oWB.Worksheets(1).Columns.AutoFit
rng.AutoFilter
Set rng = Nothing
End With
Call Reference_Designator
End Sub
Sub Reference_Designator()
' wsheet1 and wsheet2 both point to the worksheets where you are looking for info.
' row 1 tracks what row you are on in the first worksheet
' row2 treack what row you are on in the second
' crit1 tracks what your looking for in the first worksheet
' crit2 tracks what you are looking for in the second.
Dim wsheet1 As Worksheet, wsheet2 As Worksheet
Dim row1 As Long, row2 As Long
Dim crit1 As String, crit2 As String
row1 = 9
Set wsheet1 = Workbooks("Testfile2.xls").Worksheets("Sheet1")
Set wsheet2 = Workbooks("2x2component.xls").Worksheets("2x2component")
crit1 = 25
While wsheet1.Range("B" & row1) <> ""
If wsheet1.Range("A" & row1) = crit1 Then
row2 = 3
crit2 = wsheet1.Range("F" & row1)
While wsheet2.Range("B" & row2) <> ""
If wsheet2.Range("B" & row2) = crit2 Then
'last step
End If
row2 = row2 + 1
Wend
End If
row1 = row1 + 1
Wend
Call Insert_TrigFunctions
End Sub
Sub Insert_TrigFunctions()
Dim XC As Long, YC As Long
' XC, YC are coordinates of center of IC chip
Dim XP As Long, YP As Long
' XP, YP are coordinates of center of pad relative to the chip
Dim Rot As Double, DV As Double
' Rot is rotation angle, DV is a distance between center of chip to center of pad
Dim THETA As Double
' THETA is the angle of pad relative to center of chip
Dim XS As Long, YS As Long
' XS, YS are XY coordinates of solder dot
DV = (XP ^ 2 + YP ^ 2) ^ 0.5
' Equation to find Vector
THETA = Pi / 180 * (Atn(YP / XP))
' Equation to find THETA angle
YS = DV * Sin(Pi / 180 * (THETA))
' Equation to give YS in radians rather than degrees
If XP < 0 Then
THETA = THETA + 180
End If
End Sub
ya i know i got bits and pieces in there...im not finished yet...still tweaking!