Italicizing list of scientific names

M

mrwawa

Hi all,

I have a spreadsheet that includes scientific names and authors in a
single column. For example, Acer rubrum L. for red maple as named by
Linnaeus. I need to italicize the scientific name, but not the
author. I have tried to split the column into separate columns,
italicize the first two columns, and concatenate, but I lose all the
formatting. Does anyone know an easy way to do this? I assume I may
need a macro, but have only written a few in the past and am not sure
how to approach it.

Thanks for any help.

Wade
 
D

Don Guillett Excel MVP

Hi all,

I have a spreadsheet that includes scientific names and authors in a
single column.  For example, Acer rubrum L. for red maple as named by
Linnaeus.  I need to italicize the scientific name, but not the
author.  I have tried to split the column into separate columns,
italicize the first two columns, and concatenate, but I lose all the
formatting.  Does anyone know an easy way to do this?  I assume I may
need a macro, but have only written a few in the past and am not sure
how to approach it.

Thanks for any help.

Wade

"If desired, send your file to (e-mail address removed) I will only look
if:
dguillett
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 
D

Don Guillett Excel MVP

"If desired, send your file to (e-mail address removed) I will only look
if:
dguillett
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."

I sent this to OP
Option Explicit
Sub SAS_ItalizeFirstTWOwords()
Application.ScreenUpdating = False
Dim i As Long
Dim p1 As Double
Dim p2 As Double
On Error Resume Next
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
p1 = InStr(Cells(i, 1), " ")
p2 = InStr(p1 + 1, Cells(i, 1), " ")
Cells(i, 1).Characters(1, p2).Font.Italic = True
Next i
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top