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

controlz

New Member
Joined
Jul 15, 2016
Messages
8
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!!
 

controlz

New Member
Joined
Jul 15, 2016
Messages
8
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
 

Forum statistics

Threads
1,082,295
Messages
5,364,362
Members
400,792
Latest member
Dxmiian

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top