New to VBA need a code for Inputting last date modified into a target cell

MrBoris20

New Member
Joined
Aug 1, 2015
Messages
2
Thank you for looking at the post.
I am extremely new to VBA and have a basic knowledge of other coding programs enough to understand some commands and how a code is working. I am crating a spreadsheet and would like to have a code which would input date modified. So far I have mostly found what I need but the issue is that it outputs the target Now in the format "mm/dd/yyyy" into an offset (0,1).

So for a better understanding of what I am looking for. I have a spreadsheet with columns A:L and a number of rows still being increased. Columns A:F are text fields which do not need to be manipulated. G:I have numeric decimal values indicating dollar amount. Column J is a simple sum function =$G2+$H2+$I2 and Column L is a total of these columns =SUM(J:J). Now column K is my Date column. I would like this column to update to the most recently modified Date for the respective row. The only columns being manipulated though are columns G through I. So basically, if I update the monetary value in any of the columns (G:I) so that the sum total and complete total (Columns J or L) change for any row I would like K to output the current date in the cell pertaining to that edited row. It would be nice if I could overwrite the previous date values within a cell in column K each time I change a value in a row in G:I.

I have been working learn VBA and write up my own code but have run into a lot of roadblocks so I was hoping someone who already has the expertise might be willing to help me out. If you post a code and are willing to briefly summarize what the code means (basic functions of commands used) I would beyond appreciate it, though this is not necessary if you don't want to as I can always read through it and do the homework to understand it myself. Thanks in advance and I apologize if any of what I typed is confusing. As I said I am extremely new to VBA and have only a very basic understanding of coding. Thanks.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
You can use the following Event macro
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("G:I")) Is Nothing Then Exit Sub
Range("K" & Target.Row) = Date
End Sub
 
Upvote 0
You can use the following Event macro
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("G:I")) Is Nothing Then Exit Sub
Range("K" & Target.Row) = Date
End Sub

Exactly what I was looking for. Thank you a ton!
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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