how to use goal seek for multiple columns that match search criteria

controlz

New Member
Joined
Jul 15, 2016
Messages
10
I am trying to use a goal seek for every column that contains “2700” in row 38. If a column has “2700” in row 38, I’d like row 130 to equal 5 by adjusting row 50. Please note, in the row 38 contents it can be 2700 or a number of 2700 and letter combinations, which is why I have to do a search for contains "2700". I’d like this to repeat for 100 columns. Can anyone help me? I’m piecing together codes but nothing I’ve found is as flexible.

The best I can find for Goal seek is: Sub Macro1()
Dim i As Integer
For i = 1 To 100
Cells(130, i).GoalSeek Goal:=5, ChangingCell:=Cells(50, i)
Next i
End Sub
The best I can find for find is:
For i = 1 To 100


Cells.Find(What:="2700", After:=ActiveCell).Activate

What am I doing wrong?

Thanks very much in advance!!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Ignore the code above, this is the best I can do but I can't get it to continue for 100 columns.

Range("A1").Select
Cells.Find(What:="2700", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.Offset(120, 0).Range("A1").GoalSeek Goal:=5, ChangingCell:= _
ActiveCell.Offset(40, 0).Range("A1")
Cells.Find(What:="2700", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.Offset(120, 0).Range("A1").GoalSeek Goal:=5, ChangingCell:= _
ActiveCell.Offset(40, 0).Range("A1")
Cells.Find(What:="2700", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveCell.Offset(120, 0).Range("A1").GoalSeek Goal:=5, ChangingCell:= _
ActiveCell.Offset(40, 0).Range("A1")
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,241
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top