LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Loop to specific rows

Why do you keep changing your desires with each post. You really need to
learn to ask for WHAT YOU WANT the first time. You will need to use
something like

Cells(i, "c").Copy .Cells(lr, "h")
left(Cells(i, "d"),3).Copy .Cells(lr, "i")


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Omar" wrote in message
ups.com...
Don, yes that is what I wanted, I got it working now somewhat.

"HI", Sorry for not being clear, what I have is this.
Original.xls:

Row 1 User Monday Tuesday
Row 7 jack 123/45 876/54
Row12 john 526/4 456/3
Row17 Bob 231/e 314/tw

what I have to do is extract the user and id field and put it in
another xls.
I figured out how to do this without the loop. with the loop i was
having some trouble.

Another complication is that, from the id field, i just need to pull
the first three chars.so at the end the new file will look something
like:

Row 1 User ID
Row 2 jack 123
Row 3 john 526

I'll try playing around with your code and see if I can come up with
anything.

On Sep 26, 12:28 pm, HI wrote:
Sorry Omar did not mean to leave you hanging. I don't really
understand what you meant, but for your question for me how to make my
code copy... Now I must warn you this is not the best way... well
almost anything but here goes. This macro will copy values from cells
C7 etc to Test.xls to column A so that first value (C7) will go to A2
and D7 in A3 and so on. I asume you will have both original data.xls
and test.xls open and nothing else.

Sub test()
Range("c7").Select
For i = 0 To 10
For j = 0 To 6
ActiveCell.Offset(i * 5, j).Copy

Windows("Test.xls").Activate
Range("A" & 2 + k).Select
Selection.PasteSpecial Paste:=xlValues
ActiveWindow.ActivateNext
k = k + 1
Next j
Next i
End Sub

hope this helps




 
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
Counting characters in multiple rows when rows meet specific criteria news.virginmedia.com Excel Worksheet Functions 3 June 28th 08 09:03 PM
Loop thru lines of text in a cell and extract specific values: please help? Mslady[_23_] Excel Programming 2 April 3rd 06 03:22 PM
Exclude specific wks in FOR EACH wks Loop Dean Excel Programming 4 December 14th 05 06:19 PM
Loop through specific worksheets Ben Excel Programming 4 November 27th 05 02:37 PM
Macro/Loop If Statement Help -delete the row with the specific te Bricktop Excel Programming 5 October 28th 05 09:50 PM


All times are GMT +1. The time now is 09:01 AM.

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"