VBA - Copy/Paste Value formula result in adjacent cell in row

povictory

New Member
Joined
May 28, 2015
Messages
45
Hi - I'm not strong in VBA and haven't been able to find a similar thread with a helpful answer to get to my result.

I have a spreadsheet with data in columns O through Z. When those columns are updated, a formula in column K updates to a new value. My desired outcome is that I'd like for that updated value in column K to immediately be hardcoded into column L whenever the value in column K updates, as a result of new inputs in O:Z. I would like this to apply to multiple rows in the spreadsheet, let's say row 7 through 107.

Any assistance on code that would do this would be greatly appreciated!
 

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"
Something like this then? This looks at all values in K7-107 and puts them in L7-107 whenever there is a change on the sheet. This needs to be placed in the sheet specific VBA module.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    Range("L7:L107").Value = Range("K7:K107").Value
    Application.EnableEvents = True
End Sub
 
Upvote 0
Solution
Something like this then? This looks at all values in K7-107 and puts them in L7-107 whenever there is a change on the sheet. This needs to be placed in the sheet specific VBA module.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    Range("L7:L107").Value = Range("K7:K107").Value
    Application.EnableEvents = True
End Sub
Exactly what I was looking for...thank you!!
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,130
Members
453,021
Latest member
Justyna P

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