-
Next With out for error
I have anothre problem now I am getting a for without next error in my code does any one have an idea why. I am sure like the last problem it is a easy fix but I am just not seeing it
here is the code
[VBA]
RngRow25.Select
For Each RngRow25 In RFound25
If RFound25.Value = YrVal Then
With RFound25
ActiveCell.Select
.Offset(1, 1).Select
CPRange26.Copy
ActiveCell.PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
End With
Next RngRow25
RngRow27.Select
For Each RngRow27 In RFound27
If RFound25.Value = YrVal Then
With RFound27
ActiveCell.Select
.Offset(1, 1).Select
CPRange28.Copy
ActiveCell.PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
End With
Next RngRow27
[/VBA]
-
Nevermind I think it is because i do not have a end if in my code. That is why I solved it myself thanks anyway
-
1. Always use Option Explicit
2. Indenting your code will show up such errors (see my signature)
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
Thanks dude I will start to use the smart indent
-
If your problem is solved, help keep the board clean by marking your thread solved. Near the top of the page, under "Thread Tools", you'll find the button to mark your thread as solved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules