ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Stripping out contents of a cell after 8 characters? (https://www.excelbanter.com/excel-programming/322128-stripping-out-contents-cell-after-8-characters.html)

Lance Hoffmeyer

Stripping out contents of a cell after 8 characters?
 
Is there a way to strip out the contents of a cell after 8 characters?

The cell may have the following contents:
Q22_2 N22 The only supplement I ever take is a multivitamin
and I want to reduce it down to:
Q22_2

I am going to modify this as a loop to include a range of cells


Lance


JulieD

Stripping out contents of a cell after 8 characters?
 
Hi Lance

in your example to strip down to 5 characters .. so maybe something like
this will give you an idea
--

Sub strip8()
For Each c In Range("A1:A100")
c.Value = Left(c.Value, 8)
Next
End Sub

---
Cheers
JulieD

"Lance Hoffmeyer" wrote in message
. ..
Is there a way to strip out the contents of a cell after 8 characters?

The cell may have the following contents:
Q22_2 N22 The only supplement I ever take is a multivitamin
and I want to reduce it down to:
Q22_2

I am going to modify this as a loop to include a range of cells


Lance





All times are GMT +1. The time now is 01:46 PM.

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