#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default VBA Loop

Works perfectly, Bob your the man...

Bob Phillips wrote:
My bad.

iTarget = 7
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(i, "A").Value = "All" Then
Cells(i, "B").Resize(, 5).Copy _
Worksheets("Sheet2").Cells(iTarget, "A")
iTarget = iTarget + 1
End If
Next i


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JI" wrote in message
oups.com...
I keep getting a compile error and it highlights the first "Cells"
piece of code, any ideas?

Bob Phillips wrote:
Wrap-ariound

iTarget = 7
For i = 1 To Cells(Rows,Count,"A").End(xlUp).Row
If Cells(i,"A").Value = "All" Then
Cells(i,"B").Resize(,5).Copy _
Worksheets("Sheet2").Cells(iTarget,"A")
itarget = iTarget + 1
End If
Next i


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Bob Phillips" wrote in message
...

iTarget = 7
For i = 1 To Cells(Rows,Count,"A").End(xlUp).Row
If Cells(i,"A").Value = "All" Then
Cells(i,"B").Resize(,5).Copy
Worksheets("Sheet2").Cells(iTarget,"A")
itarget = iTarget + 1
End If
Next i

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"JI" wrote in message
oups.com...
My VBA knowledge isnt up to that level yet, anything more simple you
could show me something that perhaps would look at all the values in
column A:A of "sheet1" if they equaled value "All" then copy columns
B:F on that row and paste it to "sheet2" starting in row 7 column

A:A.
Thanks.





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
Worksheet loop won't loop L. Howard Kittle Excel Programming 4 March 17th 06 12:56 AM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 07:34 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"