Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Find and Replace

I have downloaded from the web the weather conditions. In cell ("a1"), it
gives humidity: 70%. I would like with VBA remove "humitity:", leaving just
the number "70%" and enter it in cell ("b1").
--
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Find and Replace

Format the cell for percentage. then use this formula

=VALUE(MID(A1,FIND(":",A1)+1,LEN(A1)))

"Daviv" wrote:

I have downloaded from the web the weather conditions. In cell ("a1"), it
gives humidity: 70%. I would like with VBA remove "humitity:", leaving just
the number "70%" and enter it in cell ("b1").
--
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Find and Replace

Maybe something like this:

In VBA, you could use this:
Range(ActiveCell.Address).Offset(0, 1).Value = Right(ActiveCell.Value,
Len(ActiveCell) - 10)

As a formula, you could use this:
In B1, enter:
=RIGHT(A1,LEN(A1)-10)


HTH,
Paul


"Daviv" wrote in message
...
I have downloaded from the web the weather conditions. In cell ("a1"), it
gives humidity: 70%. I would like with VBA remove "humitity:", leaving
just
the number "70%" and enter it in cell ("b1").
--
Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Find and Replace

I have downloaded from the web the weather conditions. In cell ("a1"), it
gives humidity: 70%. I would like with VBA remove "humitity:", leaving
just
the number "70%" and enter it in cell ("b1").


Something like this maybe...

With Range("A1")
If InStr(1, .Value, "humidity: ", vbTextCompare) 0 Then
.Offset(0, 1).Value = Mid$(.Value, InStr(.Value, " ") + 1)
End If
End With

Rick

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Find and Replace

I have downloaded from the web the weather conditions. In cell ("a1"),
it
gives humidity: 70%. I would like with VBA remove "humitity:", leaving
just
the number "70%" and enter it in cell ("b1").


Something like this maybe...

With Range("A1")
If InStr(1, .Value, "humidity: ", vbTextCompare) 0 Then
.Offset(0, 1).Value = Mid$(.Value, InStr(.Value, " ") + 1)
End If
End With


By the way, worksheet formula would execute much faster than a macro. Here
is my contribution to the worksheet formula solution...

In B1: =--REPLACE(A1,1,10,"")

Rick



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Replace - Replace with Blank Space Studebaker Excel Discussion (Misc queries) 4 April 3rd 23 10:55 AM
Find & Replace and Find & Insert macro help needed RS Excel Programming 2 January 29th 07 07:35 AM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Using Find and Replace to replace " in a macro snail30152 Excel Programming 1 April 13th 06 11:58 PM
Replace method - cannot find any data to replace Mike Excel Programming 5 April 6th 06 08:56 PM


All times are GMT +1. The time now is 05:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"