ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Event after update / calculation (https://www.excelbanter.com/excel-programming/413327-event-after-update-calculation.html)

Troubled User

Event after update / calculation
 
I have a spreadsheet with multiple sheets that run as a calculator.

I have an input sheet that routes a single column of information to the
calculator using a hlookup.

After you select a cell (column) the hlookup routes the information to the
calculator. At that point, after all the calculations are run I need copy
the information back from the calculator and store in the correct column.

I have tried using various events but everything returns the values prior to
selecting the particular column.

Any help is appreciated.

RyanH

Event after update / calculation
 
Since you posted this question in Excel Programming I am assuming you want
some VBA code. I'm not sure which event (if any) you use to apply the
calculation results to the worksheets. Do you have a Userform that does the
calculations? If not, I would just put a Command Button on a worksheet and
then assign this macro to it.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False

'puts results in specified cells
Sheet("Sheet1").Range("A1").Value = calculation1
Sheet("Sheet1").Range("A2").Value = calculation2
Sheet("Sheet1").Range("A3").Value = calculation3
Sheet("Sheet1").Range("A4").Value = calculation4
'etc.
End With

Application.ScreenUpdating = True

End Sub

Hope this helps!
--
Cheers,
Ryan


"Troubled User" wrote:

I have a spreadsheet with multiple sheets that run as a calculator.

I have an input sheet that routes a single column of information to the
calculator using a hlookup.

After you select a cell (column) the hlookup routes the information to the
calculator. At that point, after all the calculations are run I need copy
the information back from the calculator and store in the correct column.

I have tried using various events but everything returns the values prior to
selecting the particular column.

Any help is appreciated.


Bob Phillips

Event after update / calculation
 
Doesn't the calculate event give you the after-calculate view?

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Troubled User" wrote in message
...
I have a spreadsheet with multiple sheets that run as a calculator.

I have an input sheet that routes a single column of information to the
calculator using a hlookup.

After you select a cell (column) the hlookup routes the information to the
calculator. At that point, after all the calculations are run I need copy
the information back from the calculator and store in the correct column.

I have tried using various events but everything returns the values prior
to
selecting the particular column.

Any help is appreciated.




Troubled User

Event after update / calculation
 
RyanH,

Thanks for your reply. I am using the click event to determine what
information (column) to route to the calculator. I need to return the
information from the calculator without pressing a button or having the user
do anything else, it just needs to run after the calculate event so that I
get the results. If I put this in my click event, I get the results before
the calculations.

Thanks in advance.


"RyanH" wrote:

Since you posted this question in Excel Programming I am assuming you want
some VBA code. I'm not sure which event (if any) you use to apply the
calculation results to the worksheets. Do you have a Userform that does the
calculations? If not, I would just put a Command Button on a worksheet and
then assign this macro to it.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False

'puts results in specified cells
Sheet("Sheet1").Range("A1").Value = calculation1
Sheet("Sheet1").Range("A2").Value = calculation2
Sheet("Sheet1").Range("A3").Value = calculation3
Sheet("Sheet1").Range("A4").Value = calculation4
'etc.
End With

Application.ScreenUpdating = True

End Sub

Hope this helps!
--
Cheers,
Ryan


"Troubled User" wrote:

I have a spreadsheet with multiple sheets that run as a calculator.

I have an input sheet that routes a single column of information to the
calculator using a hlookup.

After you select a cell (column) the hlookup routes the information to the
calculator. At that point, after all the calculations are run I need copy
the information back from the calculator and store in the correct column.

I have tried using various events but everything returns the values prior to
selecting the particular column.

Any help is appreciated.


RyanH

Event after update / calculation
 
Cool, so you have a Click event already. Just put this portion of code at
the end of your Calculator Code. Since you said you want the calculations to
go to different worksheets and cells you will have to change the Sheet Names
and Range Address to your specifications.

Application.ScreenUpdating = False

'puts results in specified cells
Sheet("Sheet1").Range("A1").Value = calculation1
Sheet("Sheet1").Range("A2").Value = calculation2
Sheet("Sheet1").Range("A3").Value = calculation3
Sheet("Sheet1").Range("A4").Value = calculation4
'etc.
End With

Application.ScreenUpdating = True


Hope this helps!
--
Cheers,
Ryan


"Troubled User" wrote:

RyanH,

Thanks for your reply. I am using the click event to determine what
information (column) to route to the calculator. I need to return the
information from the calculator without pressing a button or having the user
do anything else, it just needs to run after the calculate event so that I
get the results. If I put this in my click event, I get the results before
the calculations.

Thanks in advance.


"RyanH" wrote:

Since you posted this question in Excel Programming I am assuming you want
some VBA code. I'm not sure which event (if any) you use to apply the
calculation results to the worksheets. Do you have a Userform that does the
calculations? If not, I would just put a Command Button on a worksheet and
then assign this macro to it.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False

'puts results in specified cells
Sheet("Sheet1").Range("A1").Value = calculation1
Sheet("Sheet1").Range("A2").Value = calculation2
Sheet("Sheet1").Range("A3").Value = calculation3
Sheet("Sheet1").Range("A4").Value = calculation4
'etc.
End With

Application.ScreenUpdating = True

End Sub

Hope this helps!
--
Cheers,
Ryan


"Troubled User" wrote:

I have a spreadsheet with multiple sheets that run as a calculator.

I have an input sheet that routes a single column of information to the
calculator using a hlookup.

After you select a cell (column) the hlookup routes the information to the
calculator. At that point, after all the calculations are run I need copy
the information back from the calculator and store in the correct column.

I have tried using various events but everything returns the values prior to
selecting the particular column.

Any help is appreciated.



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

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