ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting cell values in Excel (https://www.excelbanter.com/excel-programming/382885-setting-cell-values-excel.html)

[email protected]

Setting cell values in Excel
 
I am trying to operationalize a predictive model that calculates a new
value based on the preceding value.

I have all the necessary coefficients stored. I have factors
designated "past" and "current." When new data comes in, I'll input it
into "current" and shift previous "current" to "past." Then, previous
"past" is no longer needed.

I want to write a macro that by clicking a command button, will copy
data from "current" into "past."

For example, $38.99 is in cell E30. After clicking a command button, I
want that copied into cell F30.

I have some experience with VBA, but it's limited. Any help would be
greatly appreciated.

Thanks a lot,
Andrew


Martin Fishlock

Setting cell values in Excel
 
Hi

sub copyE30intoF30
activesheet.range("F30") .value = activesheet.range("E30") .value
end sub

assign to the button and you areaway...

I'll try not and post it another twice....
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

I am trying to operationalize a predictive model that calculates a new
value based on the preceding value.

I have all the necessary coefficients stored. I have factors
designated "past" and "current." When new data comes in, I'll input it
into "current" and shift previous "current" to "past." Then, previous
"past" is no longer needed.

I want to write a macro that by clicking a command button, will copy
data from "current" into "past."

For example, $38.99 is in cell E30. After clicking a command button, I
want that copied into cell F30.

I have some experience with VBA, but it's limited. Any help would be
greatly appreciated.

Thanks a lot,
Andrew



JLGWhiz

Setting cell values in Excel
 
sub copyE30intoF30() 'Need the Parenth
activesheet.range("F30") .value = activesheet.range("E30") .value
end sub

Now you are away.


"Martin Fishlock" wrote:

Hi

sub copyE30intoF30
activesheet.range("F30") .value = activesheet.range("E30") .value
end sub

assign to the button and you areaway...

I'll try not and post it another twice....
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

I am trying to operationalize a predictive model that calculates a new
value based on the preceding value.

I have all the necessary coefficients stored. I have factors
designated "past" and "current." When new data comes in, I'll input it
into "current" and shift previous "current" to "past." Then, previous
"past" is no longer needed.

I want to write a macro that by clicking a command button, will copy
data from "current" into "past."

For example, $38.99 is in cell E30. After clicking a command button, I
want that copied into cell F30.

I have some experience with VBA, but it's limited. Any help would be
greatly appreciated.

Thanks a lot,
Andrew




All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com