LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default repeat calculation for different combination of input?

You have your End With in the wrong place:

Next myB4
Next myB2
End With

should be

End With
Next myB4
Next myB2


Bernie


"Oligo" wrote in message
...
u mean just add the code into the current code or onto the new sheet??

i got a with without for error.

Sub MakeATable()
Dim myB2Arr As Range
Dim myB4Arr As Range
Dim myB2 As Range
Dim myB4 As Range
Dim myR As Long

Set myB2Arr = Worksheets("Main Data").Range("A3:A4")
Set myB4Arr = Worksheets("Main Data").Range("A3:A4")

For Each myB2 In myB2Arr
For Each myB4 In myB4Arr

Range("B2").Value = myB2.Value
Range("B4").Value = myB4.Value

Application.CalculateFull

With Worksheets("aa")
myR = Cells(Rows.Count, 1).End(xlUp)(2).Row
Cells(myR, 1).Value = myB2.Value
Cells(myR, 2).Value = myB4.Value
Range("G9:G11").Copy
Cells(myR, 3).PasteSpecial xlValues, Transpose:=True
Next myB4
Next myB2
End With
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
how do I repeat the input from one cell to another PeteB Excel Discussion (Misc queries) 2 December 1st 07 03:59 PM
Manual Input/Calculation in Same Cell Jean9 Excel Discussion (Misc queries) 3 November 8th 07 04:00 PM
calculation with hours and minutes - input of negative values MichaelMichael Excel Discussion (Misc queries) 2 July 10th 06 06:31 PM
how to input a calculation in excel to find the geometric mean student1 Excel Worksheet Functions 3 July 7th 05 02:21 PM
how do I get a calculation to repeat various number of times? weelittlekim Excel Worksheet Functions 1 October 27th 04 08:13 PM


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