ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Truncating values of each sale in the range (https://www.excelbanter.com/excel-programming/393331-truncating-values-each-sale-range.html)

fbagirov

Truncating values of each sale in the range
 
Each cell in a column has a 4 digit number. I need to select the whole column
up to the last raw with values and delete the last 2 digits in each cell's
number.

The code I've got for this is he

Dim MyStr as Variant
.....
Range(Cells(1, 1), Cells(LastRow, 1)).Select
For Each Cell In Selection
MyStr = Left(ActiveCell.Value, 2)
ActiveCell.Value = MyStr
Next Cell


It does not work. Can you please help ? Thanks!

Wigi

Truncating values of each sale in the range
 
'...
MyStr = Left(Cell.Value, 2)
Cell.Value = MyStr
'...


--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"fbagirov" wrote:

Each cell in a column has a 4 digit number. I need to select the whole column
up to the last raw with values and delete the last 2 digits in each cell's
number.

The code I've got for this is he

Dim MyStr as Variant
.....
Range(Cells(1, 1), Cells(LastRow, 1)).Select
For Each Cell In Selection
MyStr = Left(ActiveCell.Value, 2)
ActiveCell.Value = MyStr
Next Cell


It does not work. Can you please help ? Thanks!



All times are GMT +1. The time now is 03:34 PM.

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