I see that for this example this works fine and is the best solution. I am still wondering why it's not possible to let a macro run based on the import results.
Run Macro Based On Values In Column
-
-
-
What do you mean
Quote
why it's not possible to let a macro run based on the import results. -
It works for the first cell , i go's to the cell below. But then you need to click the button to import the result again. That should be nice if it run's without clicking again to add the result.
If you put the cursur in cell A1 and then click the Run Column button it imports the value to the Main sheet. It go's on cell down. Then you need to click again to add that value to Main sheet.
Code
Display MoreOption Explicit Sub RunColumn() Dim Target As Range Set Target = ActiveCell With Target ActiveCell.Offset(1, 0).Select 'Select the next cell (the cell below: offset(1,0) If .Value = "1" Then Call Knop23_Klikken If .Value = "2" Then Call Knop24_Klikken If .Value = "3" Then Call Knop25_Klikken If .Value = "4" Then Call Knop26_Klikken If .Value = "5" Then Call Knop27_Klikken End With End Sub
-
The code that I gave you will loop through the cells until it reaches an empty cell.
I've looked at your last workbook and this code runs fine
Code
Display MoreSub Import() Dim iX As Integer If ActiveCell.Address <> "A1" Then Range("A1").Select With ActiveCell Do Until IsEmpty(ActiveCell) iX = ActiveCell.Value Blad2.Cells(2, 1 + iX) = Blad2.Cells(2, 1 + iX) + 1 ActiveCell.Offset(1, 0).Select 'Select the next cell (the cell below: offset(1,0) Loop End With End Sub
Your unused code needs deleting
-
That's wright.
Thanks again
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!