View Single Post
 
Old 10-15-2019, 03:02 AM
ArviLaanemets ArviLaanemets is offline Windows 8 Office 2016
Expert
 
Join Date: May 2017
Posts: 932
ArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant futureArviLaanemets has a brilliant future
Default

Looks like text string is copied into cell formatted as General by VBA code!


When you have a numeric value entered into cell as string, it remains string until the cell is edited. Copying string value directly or by code into worksheet doesn't fire calculation event.


An example:
Format column A as Text. Into range A1:A3 enter values 1,2,3;
Into cell C1 enter the formula =SUM(A1:A3). The result will be 0;
Format column A as General. The result remains 0;
Edit range A1:A3 (select the range and press F2 and enter 3 times, or emter the number 1 elsewhere, copy the cell with entered 1, and use PasteSpecial>Multiply on range A1:A3). The result will be 6.
Reply With Quote