Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Do you know beforehand what kind of entries you would be having in the
range you are considering? eg: is this all going to be www.site.com/blah/blah, or could it be just about anything - john, ring.tones, http://mysearch, etc ? Joe. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I havent yet tried the two codes that are posted here, but by the looks
of it, it should work. And in case you havent done it before, you can have the code running for the whole column by following this logic: Define a starting cell: eg: define myrange = A2 Use a "Do while not isempty(myrange) (enter your filtering code here) Set myrange = myrange.offset(1,0) Loop The offset(1,0) would move your range down by one row. If you had used offset (0,1) , it would have taken you one cell to the right in the same row. and the loop as defined above would have the filter running on A2, A3, A4, etc until it hits a blank cell entry. Hope this helps. Joe. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The only way that know is this you can try it.
Regards Charles Sub test() ' Dim myString As String, myString2 As String myString = Range("A2").Value myString2 = Mid(myString, 1, InStr(InStr(InStr(myString, "/") + 1, myString, "/") + 1, myString, "/") - 1) End Sub "Shani" wrote: 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would include the the whole 'com\'
such as Sub test() ' Dim myString As String, myString2 As String myString = Range("A2").Value myString2 = Mid(myString, 1, InStr(InStr(InStr(myString, "com/") + 4, myString, "/") + 1, myString, "/") - 1) End Sub that way you could assure it was after the com and avoid mistakes at the http:// portion (if applicable) -- Wendell A. Clark, BS ------------------------------------- CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, please notify us by reply e-mail. You are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. If you have received this communication in error, please destroy all copies of this communication and any attachments. Contact the sender if it continues. "vqthomf" wrote in message ... The only way that know is this you can try it. Regards Charles Sub test() ' Dim myString As String, myString2 As String myString = Range("A2").Value myString2 = Mid(myString, 1, InStr(InStr(InStr(myString, "/") + 1, myString, "/") + 1, myString, "/") - 1) End Sub "Shani" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete rows if AF and AY empty but F has information | Excel Worksheet Functions | |||
Delete rows in a workbook that contain the same information | Excel Worksheet Functions | |||
Locking formula but delete cell information | Excel Discussion (Misc queries) | |||
delete some cell formulas and leave others using code | Excel Worksheet Functions | |||
Macro to change information and then delete it | Excel Programming |