View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
S Himmelrich S Himmelrich is offline
external usenet poster
 
Posts: 76
Default Right() error changing columns in macro

We got closer with this one, but I'm getting some rows replacing with
less characters. Basically I should be searching B3 to last cell in
column be and replacing with last six characters.....I'm not that good
with VB so I'm not clear on what I'd change in this statement "For
Each rngCells In Range(Cells(1, 2), Cells(.UsedRange.Rows.Count, 2))"




On Dec 12, 11:41 am, SeanC UK
wrote:
Hi S,

Can try:

Dim rngCells As Range
With ActiveSheet
For Each rngCells In Range(Cells(1, 2), Cells(.UsedRange.Rows.Count, 2))
rngCells.Value = Right(rngCells.Value, 6)
Next
End With

Sean.

--
(please remember to click yes if replies you receive are helpful to you)



"S Himmelrich" wrote:
I get an error when I run this in a macro...what can I do.


' Convert account column
Columns("B:B").Select
Selection.Value = Right(Range("B:B").Value, 6)- Hide quoted text -


- Show quoted text -