Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ana Ana is offline
external usenet poster
 
Posts: 44
Default Issue with my Loop Function

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?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Issue with my Loop Function

What do you mean by: InputSheet ?
You seem to have an endless loop
best wishes

--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Ana" wrote in message
...
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?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Issue with my Loop Function

Doesn't look like you're looping.
Before Wend should you add
iInputRow = iInputRow + 1


"Ana" wrote in message
...
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?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Issue with my Loop Function

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

"Ana" wrote:

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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issue with For loop [email protected] Excel Programming 2 July 9th 07 07:16 PM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
do ... until loop issue pjjclark Excel Programming 4 November 29th 05 04:24 PM
Issue with Do Loop Linking to specific cells in pivot table Excel Programming 3 July 24th 05 10:38 PM


All times are GMT +1. The time now is 11:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"