Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help with a simple macro, really lost.

I have two inputs
C2 and G2

that go through a complex blue printing system to generate a bunch of
values, call them

'sheet2'!a4
'sheet2'!b6

and a bunch more.

I want to write a macro that will get the outputs from a4 and b6 for
a range of 1 to 100 for c2 and 1 to 100 for g2 and display it on two
columns

C2 | G2 | output from a4 | output from b6 |
1 1 ouput1 output1
1 2 output2 output2
....
100 100 output9999 output9999
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Need help with a simple macro, really lost.

Are the inputs on the same sheet as the outputs, or on a different
sheet ?

dim i,x

for 1=1 to 100






Tim

On Feb 8, 2:30*pm, "Mike L." wrote:
I have two inputs
C2 and G2

that go through a complex blue printing system to generate a bunch of
values, call them

'sheet2'!a4
'sheet2'!b6

and a bunch more.

I want to write *a macro that will get the outputs from a4 and b6 for
a range of 1 to 100 for c2 and 1 to 100 for g2 and display it on two
columns

C2 | G2 | output from a4 | output from b6 |
*1 * * 1 * * * * *ouput1 * * * * * * * * output1
*1 * * 2 * * * * *output2 * * * * * * * * output2
...
100 *100 * * * output9999 * * * * * output9999


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default Need help with a simple macro, really lost.

Not clear if your inputs are on the same sheet as the outputs: this
assumes a different sheet....

Sub GetValues()

Dim a, b
Dim rngResult As Range
Dim shtOutput As Worksheet, shtInput As Worksheet

Set shtInput = ThisWorkbook.Sheets("Sheet1")
Set shtOutput = ThisWorkbook.Sheets("Sheet2")
Set rngResult = ThisWorkbook.Sheets("Results").Rows(2)

For a = 1 To 100
For b = 1 To 100

shtInput.Range("C2").Value = a
shtInput.Range("G2").Value = b
Application.Calculate
DoEvents

With rngResult
.Cells(1).Value = a
.Cells(2).Value = b
.Cells(3).Value = shtOutput.Range("A4").Value
.Cells(4).Value = shtOutput.Range("B6").Value
End With

Set rngResult = rngResult.Offset(1, 0)
Next b
Next a

End Sub



On Feb 8, 2:30*pm, "Mike L." wrote:
I have two inputs
C2 and G2

that go through a complex blue printing system to generate a bunch of
values, call them

'sheet2'!a4
'sheet2'!b6

and a bunch more.

I want to write *a macro that will get the outputs from a4 and b6 for
a range of 1 to 100 for c2 and 1 to 100 for g2 and display it on two
columns

C2 | G2 | output from a4 | output from b6 |
*1 * * 1 * * * * *ouput1 * * * * * * * * output1
*1 * * 2 * * * * *output2 * * * * * * * * output2
...
100 *100 * * * output9999 * * * * * output9999


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
Macro gets lost Ron Olcott Excel Programming 3 February 13th 08 11:00 PM
How do I find a lost macro? Jan Excel Discussion (Misc queries) 2 July 23rd 07 08:42 PM
How do I keep a running total of pounds lost and percentage lost angel5959 Excel Discussion (Misc queries) 4 January 26th 06 09:18 PM
macro lost Pam Coleman Excel Discussion (Misc queries) 1 February 24th 05 08:27 PM
lost password in a macro Planetnieuws Excel Programming 2 July 25th 03 10:50 AM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"