ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Font strikethrough (https://www.excelbanter.com/excel-programming/316913-font-strikethrough.html)

Ben

Font strikethrough
 
Hi,

How can i coded in vba to check whether the column of two words in the cells
has the font strikrthrough equal to true and append the word in cell with "is
strikethrough".
example: column a column b column d
apple apple apple is strikethough


where apple is strike through.

thanks,

regards,
Ben

Frank Kabel

Font strikethrough
 
Hi
try
with activesheet.range("A1")
if .Font.Strikethrough or .offset(0,1).Font.Strikethrough then
.offset(0,3).value="is strikethrough"
end if
end with

"Ben" wrote:

Hi,

How can i coded in vba to check whether the column of two words in the cells
has the font strikrthrough equal to true and append the word in cell with "is
strikethrough".
example: column a column b column d
apple apple apple is strikethough


where apple is strike through.

thanks,

regards,
Ben


Ben

Font strikethrough
 
Hi Frank,
Thanks, it works well. Can it be used in the range of cells for example from
range "a2:a400"?
how do u coded in vba?

thanks.

regards,
Ben



"Frank Kabel" wrote:

Hi
try
with activesheet.range("A1")
if .Font.Strikethrough or .offset(0,1).Font.Strikethrough then
.offset(0,3).value="is strikethrough"
end if
end with

"Ben" wrote:

Hi,

How can i coded in vba to check whether the column of two words in the cells
has the font strikrthrough equal to true and append the word in cell with "is
strikethrough".
example: column a column b column d
apple apple apple is strikethough


where apple is strike through.

thanks,

regards,
Ben


Dave Peterson[_5_]

Font strikethrough
 
How about:

Option Explicit
Sub testme01()
Dim myCell As Range

For Each myCell In ActiveSheet.Range("A1:A400").Cells
With myCell
If .Font.Strikethrough _
Or .Offset(0, 1).Font.Strikethrough Then
.Offset(0, 3).Value = "is strikethrough"
End If
End With
Next myCell


End Sub




Ben wrote:

Hi Frank,
Thanks, it works well. Can it be used in the range of cells for example from
range "a2:a400"?
how do u coded in vba?

thanks.

regards,
Ben

"Frank Kabel" wrote:

Hi
try
with activesheet.range("A1")
if .Font.Strikethrough or .offset(0,1).Font.Strikethrough then
.offset(0,3).value="is strikethrough"
end if
end with

"Ben" wrote:

Hi,

How can i coded in vba to check whether the column of two words in the cells
has the font strikrthrough equal to true and append the word in cell with "is
strikethrough".
example: column a column b column d
apple apple apple is strikethough


where apple is strike through.

thanks,

regards,
Ben


--

Dave Peterson

Ben

Font strikethrough
 
Hi,

Can it be checked that for the range of the cell(a2:a400), some of the cell
may not necessary contained the strikethrough word? can it be done?

thanks,

regards,
Ben

"Dave Peterson" wrote:

How about:

Option Explicit
Sub testme01()
Dim myCell As Range

For Each myCell In ActiveSheet.Range("A1:A400").Cells
With myCell
If .Font.Strikethrough _
Or .Offset(0, 1).Font.Strikethrough Then
.Offset(0, 3).Value = "is strikethrough"
End If
End With
Next myCell


End Sub




Ben wrote:

Hi Frank,
Thanks, it works well. Can it be used in the range of cells for example from
range "a2:a400"?
how do u coded in vba?

thanks.

regards,
Ben

"Frank Kabel" wrote:

Hi
try
with activesheet.range("A1")
if .Font.Strikethrough or .offset(0,1).Font.Strikethrough then
.offset(0,3).value="is strikethrough"
end if
end with

"Ben" wrote:

Hi,

How can i coded in vba to check whether the column of two words in the cells
has the font strikrthrough equal to true and append the word in cell with "is
strikethrough".
example: column a column b column d
apple apple apple is strikethough


where apple is strike through.

thanks,

regards,
Ben


--

Dave Peterson


Dave Peterson[_5_]

Font strikethrough
 
Do you mean some of the cells are strikethrough and some aren't strikethrough?

Or do you mean some of the words in each cell are strikethrough and some are not
(possibly a mixture of both)???

I'm guessing you meant the mixture within the cell.

And just A2:A400,

Option Explicit
Sub testme01()
Dim myCell As Range

For Each myCell In ActiveSheet.Range("A2:A400").Cells
With myCell
If .Font.Strikethrough = False Then
'not there
Else
'either True or null
.Offset(0, 3).Value = "is strikethrough"
End If
End With
Next myCell

End Sub



Ben wrote:

Hi,

Can it be checked that for the range of the cell(a2:a400), some of the cell
may not necessary contained the strikethrough word? can it be done?

thanks,

regards,
Ben

"Dave Peterson" wrote:

How about:

Option Explicit
Sub testme01()
Dim myCell As Range

For Each myCell In ActiveSheet.Range("A1:A400").Cells
With myCell
If .Font.Strikethrough _
Or .Offset(0, 1).Font.Strikethrough Then
.Offset(0, 3).Value = "is strikethrough"
End If
End With
Next myCell


End Sub




Ben wrote:

Hi Frank,
Thanks, it works well. Can it be used in the range of cells for example from
range "a2:a400"?
how do u coded in vba?

thanks.

regards,
Ben

"Frank Kabel" wrote:

Hi
try
with activesheet.range("A1")
if .Font.Strikethrough or .offset(0,1).Font.Strikethrough then
.offset(0,3).value="is strikethrough"
end if
end with

"Ben" wrote:

Hi,

How can i coded in vba to check whether the column of two words in the cells
has the font strikrthrough equal to true and append the word in cell with "is
strikethrough".
example: column a column b column d
apple apple apple is strikethough


where apple is strike through.

thanks,

regards,
Ben


--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 12:35 AM.

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