Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Application.left VBA
Can somenone help fixing the VBA macro?
Sub trimit() Dim rng As Range Set target = Range("A2:H" & Range("A2").End(xlDown).Row) Set rng1 = Range("F2:H" & Range("F2").End(xlDown).Row) For Each cell In target cell.Value = Trim(Application.Left(Range("target")), 10, 0 Range("rng1") = cell.Value Next End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Application.left VBA
maybe to get the left 10 characters in cell F.
Sub trimit() for each c in Range("A2:H" & Range("A2").End(xlDown).Row) c.Value = left(c.offset(,5),10) 'or to trim the cell first and then get the left 10 'c.Value = left(application.trim(c.offset(,5)),10) Next c End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff" wrote in message ... Can somenone help fixing the VBA macro? Sub trimit() Dim rng As Range Set target = Range("A2:H" & Range("A2").End(xlDown).Row) Set rng1 = Range("F2:H" & Range("F2").End(xlDown).Row) For Each cell In target cell.Value = Trim(Application.Left(Range("target")), 10, 0 Range("rng1") = cell.Value Next End Sub |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Application.left VBA
What I need is to put the value c in column F after "left" and "trim".
"Jeff" wrote: Can somenone help fixing the VBA macro? Sub trimit() Dim rng As Range Set target = Range("A2:H" & Range("A2").End(xlDown).Row) Set rng1 = Range("F2:H" & Range("F2").End(xlDown).Row) For Each cell In target cell.Value = Trim(Application.Left(Range("target")), 10, 0 Range("rng1") = cell.Value Next End Sub |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Application.left VBA
If? you are saying you want the right, then have a look at RIGHT and LEN
-- Don Guillett Microsoft MVP Excel SalesAid Software "Jeff" wrote in message ... What I need is to put the value c in column F after "left" and "trim". "Jeff" wrote: Can somenone help fixing the VBA macro? Sub trimit() Dim rng As Range Set target = Range("A2:H" & Range("A2").End(xlDown).Row) Set rng1 = Range("F2:H" & Range("F2").End(xlDown).Row) For Each cell In target cell.Value = Trim(Application.Left(Range("target")), 10, 0 Range("rng1") = cell.Value Next End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LEFT function-all to left of a comma? | Excel Worksheet Functions | |||
when inserting new worksheets they read right to left not left to. | Setting up and Configuration of Excel | |||
My Excel view is Right to Left instead of Left to Right !!! | Excel Discussion (Misc queries) | |||
Column labels run right to left, not left to right | Excel Discussion (Misc queries) | |||
How to change the right-to-left worksheet to left-to-right workshe | Excel Discussion (Misc queries) |