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
- Sub valueWithoughtFormat()
- For Each r In Selection
- r.Value = Chr(39) & r.Text
- End Sub
You need to login to post a comment.