ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete etxra information from cells (https://www.excelbanter.com/excel-programming/360995-delete-etxra-information-cells.html)

Shani

Delete etxra information from cells
 
I need to delete information in cell

for example if A2= http://google.com/help/you/me

I want to remove everything after "com"

So i would want A2 = http://google.com


Chip Pearson

Delete etxra information from cells
 
Try something like

Dim Pos As Long
Pos = InStr(Range("A1").Text, ".com")
If Pos = 0 Then
Exit Sub
End If
Range("A1").Value = Left(Range("A1").Text, Pos + 3)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Shani" wrote in message
oups.com...
I need to delete information in cell

for example if A2= http://google.com/help/you/me

I want to remove everything after "com"

So i would want A2 = http://google.com




Niek Otten

Delete etxra information from cells
 
=LEFT(A2,FIND("com",A2)+2)

--
Kind regards,

Niek Otten

"Shani" wrote in message oups.com...
|I need to delete information in cell
|
| for example if A2= http://google.com/help/you/me
|
| I want to remove everything after "com"
|
| So i would want A2 = http://google.com
|



Shani

Delete etxra information from cells
 
thank you very much



All times are GMT +1. The time now is 10:57 AM.

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