Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Forcing cell value update/refresh

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Forcing cell value update/refresh

Say we want to refresh Z100:

Range("Z100").Calculate
or
Range("Z100").Replace What:="=", Replacement:="="
--
Gary''s Student - gsnu200768


"#DIV/0" wrote:

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Forcing cell value update/refresh

I'm not sure how you're doing it, but make sure you format the destination cell
before inserting the value.

with activesheet.range("a1")
.numberformat = "General" 'or what you want
.value = me.combobox1.value 'or whatever
end with

If this doesn't help, what are you putting into the cell?

#DIV/0 wrote:

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Forcing cell value update/refresh

Hi
I tried both your suggestions but I'm still not getting results.
I'm putting formulae into various cells on the sheet. Part of the formulae
is made up of text strings I've picked up during the macro such as

ActiveCell.Formula = "=SUM('LISTING'!B1:B" & TheRow & ")"

What I see in the cell is #NAME? until I double-click it and press enter.
Then the cell realises it contains a formula and does the calculation.
Any ideas ?

--
David M
WinXP - Office2003 (Italian)


"Gary''s Student" wrote:

Say we want to refresh Z100:

Range("Z100").Calculate
or
Range("Z100").Replace What:="=", Replacement:="="
--
Gary''s Student - gsnu200768


"#DIV/0" wrote:

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Forcing cell value update/refresh

Hi Dave,
Thanks for your response but I'm afraid the wording in my post makes the
problem sound like formatting, but if you look at my reply to Gary's Student
you'll see that's not quite it.

--
David M
WinXP - Office2003 (Italian)


"Dave Peterson" wrote:

I'm not sure how you're doing it, but make sure you format the destination cell
before inserting the value.

with activesheet.range("a1")
.numberformat = "General" 'or what you want
.value = me.combobox1.value 'or whatever
end with

If this doesn't help, what are you putting into the cell?

#DIV/0 wrote:

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Forcing cell value update/refresh

Under some circumstances, putting a formula in a cell with code rather than
the Excel UI results in Excel not seeing the result as a formula. Try this
first:

ActiveCell.Clear
ActiveCell.Formula = "=SUM('LISTING'!B1:B" & TheRow & ")"

if this does not work, then try:

ActiveCell.Formula = "=SUM('LISTING'!B1:B" & TheRow & ")"
Application.SendKeys "{F2}"
Application.SendKeys "{ENTER}"
DoEvents

--
Gary''s Student - gsnu200768


"#DIV/0" wrote:

Hi
I tried both your suggestions but I'm still not getting results.
I'm putting formulae into various cells on the sheet. Part of the formulae
is made up of text strings I've picked up during the macro such as

ActiveCell.Formula = "=SUM('LISTING'!B1:B" & TheRow & ")"

What I see in the cell is #NAME? until I double-click it and press enter.
Then the cell realises it contains a formula and does the calculation.
Any ideas ?

--
David M
WinXP - Office2003 (Italian)


"Gary''s Student" wrote:

Say we want to refresh Z100:

Range("Z100").Calculate
or
Range("Z100").Replace What:="=", Replacement:="="
--
Gary''s Student - gsnu200768


"#DIV/0" wrote:

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Forcing cell value update/refresh

Did you try changing the numberformat to general first?

#DIV/0 wrote:

Hi Dave,
Thanks for your response but I'm afraid the wording in my post makes the
problem sound like formatting, but if you look at my reply to Gary's Student
you'll see that's not quite it.

--
David M
WinXP - Office2003 (Italian)

"Dave Peterson" wrote:

I'm not sure how you're doing it, but make sure you format the destination cell
before inserting the value.

with activesheet.range("a1")
.numberformat = "General" 'or what you want
.value = me.combobox1.value 'or whatever
end with

If this doesn't help, what are you putting into the cell?

#DIV/0 wrote:

I'm pretty sure I read the solution to this but after searching for ages
can't find it so sorry if this is a repeat...

I'm placing values into a worksheet from a userform and the only way I can
get them to take the format of the destination cell is by double-clicking
then pressing enter.
Isn't there any way of forcing this ?

--
David M
WinXP - Office2003 (Italian)


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing cell with user function to update on workbook open? Don Wiss Excel Programming 2 April 6th 07 01:30 AM
forcing refresh links Stefi Excel Discussion (Misc queries) 11 April 4th 07 01:51 PM
forcing excel to update the Cell Link when copying Combo Boxes Baraki0568 Excel Worksheet Functions 0 September 13th 06 04:16 AM
Date in cell to update upon Pivot Table refresh chris46521[_33_] Excel Programming 4 August 17th 06 11:02 PM
Forcing users to update spreadsheets DKerr Excel Discussion (Misc queries) 2 July 27th 06 12:55 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"