Issue with my Loop Function

  • Thread starter Thread starter Ana
  • Start date Start date
A

Ana

Sub Ana()

Dim iInputRow As Long
Dim iEquityRow As Long
Dim iSpotFxRow As Long
Dim iOptionFXRow As Long
Dim iOptionRow As Long
Dim iCFDRow As Long
Dim iFutureRow As Long
Dim sType As String

iInputRow = 2
iEquityRow = 2


While InputSheet.Cells(iInputRow, 2) <> ""
sType = InputSheet.Cells(iInputRow, 3)


If sType = "Equity" Then
'paste equity

End If


Wend


End Sub


This part: While InputSheet.Cells(iInputRow, 2) <> ""

Is giving me an error and I'm not quite sure why?
Could someone help me?
 
What do you mean by: InputSheet ?
You seem to have an endless loop
best wishes
 
Doesn't look like you're looping.
Before Wend should you add
iInputRow = iInputRow + 1
 
While Len(InputSheet.Cells(iInputRow, 2).Formula) > 0
sType = InputSheet.Cells(iInputRow, 3)
If sType = "Equity" Then
'paste equity
End If
iInputRow = iInputRow + 1
Wend
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top