auto run macro when cell value changes

Moose1605

New Member
Joined
Dec 19, 2016
Messages
27
Hi i'm kristof,

I'm totally new here and also with excel.
i try to make a macro when a value chanes in a cell that it auto run , but don't find how.
this is what i have to get my info from the other sheet.

Code:
Subtechniek()[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Sheets("OffertePP").Select[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Range("E41:E46").Select[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Selection.ClearContents[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]For i = 0To 4[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]IfRange("D41") = "Basic" Then Cells(41 + i, 5) =Sheets("Config").Cells(85 + i, 12)[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]IfRange("D41") = "Comfort" Then Cells(41 + i, 5) =Sheets("Config").Cells(91 + i, 12)[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]IfRange("D41") = "Exclusive" Then Cells(41 + i, 5) =Sheets("Config").Cells(98 + i, 12)[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000] [/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]Next i[/COLOR][/SIZE][/FONT]
[FONT=Calibri][SIZE=3][COLOR=#000000]End Sub
[FONT=Calibri][SIZE=3][COLOR=#000000]

ps sorry for my englisch
<strike></strike>
[/COLOR][/SIZE][/FONT]
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
you can use the worksheet_change event if it is a specific range of cells that someone manually changes it will normally incorporate TARGET & INTERSECT, many varied examples all over the place to pick from
 
Upvote 0
ok thx

i did this but what is wrong?
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$41" Then
Call typeline
End If
End Sub

typeline is my macro

Code:
Sub typeline()
Sheets("Offerte PP").Select
Range("E41:E46").Select
Selection.ClearContents
For i = 0 To 4
If Range("D41") = "Basic" Then Cells(41 + i, 5) = Sheets("Config").Cells(85 + i, 12)
If Range("D41") = "Comfort" Then Cells(41 + i, 5) = Sheets("Config").Cells(91 + i, 12)
If Range("D41") = "Exclusive" Then Cells(41 + i, 5) = Sheets("Config").Cells(98 + i, 12)
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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