LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Using Do Loops to copy data

I need a bit of code that will search through each cell in a column and look
for Agent Name: then choose cell to its right and create a new sheet with
the value of the selected cell as the name.

Below I have added what I tried, which obviously did not work. Any help on
this would be greatly appreciated. (Note, I can make the new sheet and name
it, so my test code just had a msgbox pop up with the value for testing)

=-=-=-=-=-=-=-=

Dim rngEdit As Range
Dim trow As Integer
Dim tcol As Integer
Dim tname As String

Sub LoopIt()
trow = 1
tcol = 3
Set rngEdit = ActiveSheet.Cells(trow, tcol)
Do Until rngEdit.Value = "Agent Name:"
trow = trow + 1
Loop
tcol = tcol + 1
tname = ActiveSheet.Cells(trow, tcol).Value
tcol = tcol - 1
MsgBox trow & " " & tcol
End Sub

 
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
Loops David Excel Programming 1 February 10th 06 10:55 PM
Loops fugfug[_2_] Excel Programming 3 July 8th 05 10:53 AM
Vlookup macro that returns data from worksheet, then Loops xlsxlsxls[_3_] Excel Programming 4 October 23rd 04 05:48 PM
Vlookup macro that returns data from worksheet, then Loops xlsxlsxls[_4_] Excel Programming 0 October 23rd 04 05:43 PM
for each loops adncmm1980[_3_] Excel Programming 1 October 4th 04 12:56 PM


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