VBA to pull text out of cell

helpexcel

Well-known Member
Joined
Oct 21, 2009
Messages
656
Hi - Is there a way to say look in A10 and if the word "March" appears, put "March" in B10?

Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
How about
=IF(ISNUMBER(SEARCH("March",A10)),"March","")
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
how would i incorporate that into a sumif? and can i us a reference list? So if text in A10:A30 contains a month the month is shown in B10:B30
 
Upvote 0
I don't understand what you are asking.

Can you please post some data, along with an explanation of what you are trying to do & sample results.
 
Upvote 0
I have data in Column A that includes text, which also has the month. I'm trying to sum by month, with the months listed in column B.

Data In Out
In January 1 January 1 January 0
In March 2 February 0 February 4
In April 3 March 2 March 0
Out February 4 April 3 April 0
Out June 5 May 0 May 0
In July 6 June 0 June 5
July 6 July 0
August 0 August 0
September 0 September 0
October 0 October 0
November 0 November 0
December 0 December 0
 
Upvote 0
Column A Column B Column C
DataInOut
In January1January1January0
In March2February0February4
In April3March2March0
Out February4April3April0
Out June5May0May0
In July6June0June5
July6July0
August0August0
September0September0
October0October0
November0November0
December0December0

<tbody>
</tbody>
 
Last edited:
Upvote 0
Whilst that is better, it's still not clear what is in which column, you say cols A,B 7 C, but it looks like you have 6 columns.
Also I cannot see where those numbers come from, or what you are trying to sum.
 
Upvote 0

Forum statistics

Threads
1,215,377
Messages
6,124,598
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top