inserts values into 3 cells

PIsabel

Board Regular
Joined
Feb 4, 2014
Messages
126
Office Version
  1. 365
Platform
  1. Windows
Hello.
I need a macro that inserts values into 3 cells (F1 = Isabel, F2 = Pedro, F3 = Date) if cell A1 changes value.

Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Not Target.Address = "$A$1" Then Exit Sub
Application.EnableEvents = False
   Range("F1:F3").Value = Application.Transpose(Array("Isabel", "Pedro", "Date"))
Application.EnableEvents = True
End Sub
This needs to go in the sheet module
 
Last edited:
Upvote 0
How about
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.CountLarge > 1 Then Exit Sub
   If Not Target.Address = "$A$1" Then Exit Sub
Application.EnableEvents = False
   [B][COLOR="#FF0000"]Range("F1:F3").Value = Application.Transpose(Array("Isabel", "Pedro", "Date"))[/COLOR][/B]
Application.EnableEvents = True
End Sub
This needs to go in the sheet module
If the three text values being assign to F1:F3 are really unchanging text constants (not variables), then the above highlighted code line can be replaced with this one...
Code:
[F1:F3] = [{"Isabel";"Pedro";"Date"}]
 
Upvote 0
Is working
Thank you.

I have a very similar sheet but it only inserts values if cell K33 = Done in cell R34 = Closed and R36 = Confirmed
 
Upvote 0
What values do you want to insert & where do they go?
 
Upvote 0
in an autorun macro and if de K33 value change
 
Last edited:
Upvote 0
in an autorun macro and if de K33 value change
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.CountLarge > 1 Then Exit Sub
  If Not Target.Address(0, 0) = "K33" Then Exit Sub
  Application.EnableEvents = False
  If Target.Value = "Done" Then
    Range("R34").Value = "Closed"
    Range("R36").Value = "Confirmed"
  End If
  Application.EnableEvents = True
End Sub
 
Upvote 0
thank you so much

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Target.CountLarge > 1 Then Exit Sub
  If Not Target.Address(0, 0) = "K33" Then Exit Sub
  Application.EnableEvents = False
  If Target.Value = "Done" Then
    Range("R34").Value = "Closed"
    Range("R36").Value = "Confirmed"
  End If
  Application.EnableEvents = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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