|
-
Sep 6th, 2005, 06:08 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] For each record loop? - VBA
Disclaimer - Newer to VBA.
I have a sheet I want to print out, for each record in a range.
In the range, I have the following data:
Apple
Grape
Pear
Apricot
The price breaks are based on information in columns 2 - 4 of the range.
I have a seperate window, which is all formated pretty like. What I want to do is enter Apple in the top cell (programatically) and print the page, then change Apple to Grape, and print the page again.
I am trying to do something like a For each, Do Loop....but am not having any luck....any ideas ?
Talk does not cook rice.
-Chinese Proverb
-
Sep 7th, 2005, 08:22 AM
#2
Frenzied Member
Re: For each record loop? - VBA
This is Excel? When you say a "separate window", do you mean that you have 2 Excel workbooks open and you want to take the fruity data from a sheet in one workbook and programmatically use that to operate on a sheet in the second workbook?
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Sep 7th, 2005, 08:27 AM
#3
Re: For each record loop? - VBA
Try the following
VB Code:
Sub loop_example()
Dim MyRange As Range
Dim MyCell As Range
Set MyRange = 'Insert your range here
For Each MyCell In MyRange.Columns(1).Cells
MsgBox MyCell.Value
Next MyCell
End Sub
-
Sep 7th, 2005, 09:29 AM
#4
Thread Starter
Hyperactive Member
Re: For each record loop? - VBA
DKenny!
You Rock! Works Great!
Sorry, webtest...I should have been clearer...different worksheet...only one instance of Excel is running....
The printer is going wild !!
Talk does not cook rice.
-Chinese Proverb
-
Sep 7th, 2005, 09:35 AM
#5
Frenzied Member
Re: [RESOLVED] For each record loop? - VBA
"The printer is going wild !!"
Post your code.
Blessings in abundance,
All the Best,
& ENJOY!
Art . . . . Carlisle, PA . . USA
-
Sep 7th, 2005, 09:46 AM
#6
Thread Starter
Hyperactive Member
Re: [RESOLVED] For each record loop? - VBA
That is a good thing.
I have a hundred or so items, and it is changing the item and printing the page, changing the item and printing the page.....
all I have to do is press one button!
This is great!
Talk does not cook rice.
-Chinese Proverb
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
|
Click Here to Expand Forum to Full Width
|