/ Published in: Visual Basic

Excel macro to copy values from formated cells. For example:
If you have a sheet that has huge numbers in millions for example 1,312,323 and you apply a format to the cell such that only 1.3 is displayed, if you want to copy 1.3 and put it in a database (without the format) use the following snippet.
Select all the cells you want to apply this macro and run it.
Note: this will convert the cell values to string
If you have a sheet that has huge numbers in millions for example 1,312,323 and you apply a format to the cell such that only 1.3 is displayed, if you want to copy 1.3 and put it in a database (without the format) use the following snippet.
Select all the cells you want to apply this macro and run it.
Note: this will convert the cell values to string
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Sub valueWithoughtFormat() For Each r In Selection r.Value = Chr(39) & r.Text Next End Sub
Comments
