LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Formatting help

This is working just perfectly. Thankyou for your invaluable help.
Charles Chickering wrote:
Keri, if this does not work please email the workbook to
--
Charles Chickering

"A good example is twice the value of good advice."


"Charles Chickering" wrote:

Perhaps we need to specify the Search direction in the first find statement:
Set rSearch = Sheets("cardata" & k).Range("B:B"). _
Find(What:="P", LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True)
--
Charles Chickering

"A good example is twice the value of good advice."


"keri" wrote:

I have discovered two more things.

I can run this code AFTER I have put each of these "tables" into
another sheet, which solves the problem I was wittering on about above!

However the code is only finding the first P and moving it into the
first column. I need it to search all the cells below this column and
move the P across into the first column if it exists.

Secondly I have tried to get this code to look through my sheets as
below but it doesn't like it (suprise suprise seeing as I wrote it!).

(Answer is already defined as a global variable)

Dim k As Integer
Dim rSearch As Range
Dim rFirst As Range

For k = 1 To answer

Set rSearch = Sheets("cardata" & k).Range("B:B").Find(what:="P",
LookAt:=xlPart)
If rSearch Is Nothing Then Exit Sub
Set rFirst = rSearch
Do
rSearch.Offset(, -1) = rSearch.Offset(, -1) & "P"
rSearch.FindNext After:=rSearch
Loop Until rSearch.Address = rFirst.Address
rSearch.EntireColumn.Delete
Next k
End Sub

Thanks experts!





 
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
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
expanding custom formatting without removing existing cell formatting? Keith Excel Worksheet Functions 3 December 27th 06 01:54 PM
Decimal Formatting in Windows English vs European Formatting Drummer361 Excel Programming 3 August 7th 06 02:48 PM


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

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"