LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default deleting characters from autofiltered cells.

I'm using the following subroutine to look at a specific autofiltered
cell, and if there are caret characters in it, to make the text in
between italic. Then it is supposed to delete the carets (^). It (or
a variation of it) worked in non-autofiltered cells. Here, the
italics line works, but the delete line causes a 1004 error. Here's
the code: ("C" is the specific cell)

Sub MakeItalic(C As Object)
Dim D1 As Integer
Dim D2 As Integer
Dim rng As Range
Set rng = Worksheets("Student_Data").AutoFilter.Range
rw1 = C.Row
clm1 = C.Column
Do While InStr(1, C.Text, "^")
D1 = Int(InStr(1, C.Text, "^"))
D2 = Int(InStr(D1 + 1, C.Text, "^"))
rng.Characters(Start:=D1 + 1, Length:=(D2 - 1) -
D1).Font.FontStyle = "Italic"
rng.Cells(rw1, clm1).Characters(Start:=D2, Length:=1).Delete
Worksheets("Student_Data").Cells(rw1, clm1).Characters(Start:=D1,
Length:=1).Delete
Loop
End Sub
 
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
Deleting LF Characters in cells BillH Excel Worksheet Functions 10 March 19th 08 10:19 PM
How do I add up cells that are autofiltered? PayPaul Excel Worksheet Functions 4 November 12th 07 06:49 PM
Copying Autofiltered cells Brad[_22_] Excel Programming 2 March 5th 06 04:31 AM
autofiltered cells minostrada Excel Programming 1 November 7th 05 01:51 PM
Deleting AutoFiltered Rows Nirmal Singh Excel Programming 11 February 7th 05 06:41 PM


All times are GMT +1. The time now is 01:37 PM.

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

About Us

"It's about Microsoft Excel"