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

*** post for FREE via your newsreader at post.newsfeed.com ***

Hello,

I have a spreadsheet that is essentially a database of employees and
their weekly schedules. I am trying to write a macro that will loop
through the entire sheet taking an employee and their information one row
at a time. I don't really know VBA at all, but I (hope I) am competent
enough to pick it up quickly.

This is pseudocode for what I want:

while ( another_row ) {
read ( name );
read ( schedule );
write_to_file ( name, schedule );
}

Thanks!

Andrew


-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Looping

This is sort of simple, but it is a start, if you have
not used VB. It just makes a sort of copy of what already
exists.
Sub Macro1()
Do While ActiveCell.Value < ""
ActiveCell.Offset(1, 0).Select
ActiveCell.Range("A1:B1").Select
Selection.Copy
Sheets("Sheet2").Select
Range("A1").Select
Selection.End(xlDown).Select
If ActiveCell.Row = 65536 Then
Range("A1").Select
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
Else
ActiveCell.Offset(1, 0).Range("A1").Select
ActiveSheet.Paste
End If
Sheets("Sheet1").Select
Application.CutCopyMode = False
'ActiveCell.Offset(1, 0).Range("A1:B1").Select
Loop
Sheets("Sheet1").Select
End Sub

-----Original Message-----
*** post for FREE via your newsreader at

post.newsfeed.com ***

Hello,

I have a spreadsheet that is essentially a database of

employees and
their weekly schedules. I am trying to write a macro

that will loop
through the entire sheet taking an employee and their

information one row
at a time. I don't really know VBA at all, but I (hope

I) am competent
enough to pick it up quickly.

This is pseudocode for what I want:

while ( another_row ) {
read ( name );
read ( schedule );
write_to_file ( name, schedule );
}

Thanks!

Andrew


-----= Posted via Newsfeed.Com, Uncensored Usenet News

=-----
http://www.newsfeed.com - The #1 Newsgroup Service in

the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited

Download! =-----

.

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
Looping David T Excel Discussion (Misc queries) 2 August 30th 06 10:51 PM
Looping [email protected] Excel Programming 0 October 31st 03 07:47 PM
Looping Stuart[_9_] Excel Programming 0 October 29th 03 11:31 PM
Looping J.E. McGimpsey Excel Programming 0 October 29th 03 11:09 PM
Need Looping Help [email protected] Excel Programming 2 October 29th 03 08:11 PM


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