PC Review


Reply
Thread Tools Rate Thread

Delete cells with text and shift left?

 
 
Ryk
Guest
Posts: n/a
 
      10th Nov 2006
I have this from surfing here and it not work. What I have is column A
with headings, and what I copy into this would look something like this
for example....
( Used | to show cells)

Value|of|item|is|45|23|12|blah|23|16

What I need it to end up looking like is...

Value|45|23|12|23|16

It would need look for text in cells and delete those cells and shift
left over 7-8 columns.

The
Sub MoveText()
Dim rCell As Range
Dim rCheck As Range
' either select a column, range or whatever on the sheet or
' set a value
'set rCheck=selection
Set rCheck = Range("D115")
For Each rCell In rCheck
If IsDate(rCell) Then
rCell.Offset(0, -1).Delete Shift:=xlToLeft
End If
Next
Set rCell = Nothing
Set rCheck = Nothing
End Sub

The " If IsDate(rCell) Then " above I tried changing to " If
Istext(rCell) Then" but that not work. Ok Ok I am not the brightest
excel Bulb heheh.

Thanks for any help

Dave

 
Reply With Quote
 
 
 
 
tina
Guest
Posts: n/a
 
      10th Nov 2006
suggest you start by posting your question to an Excel newsgroup. this
newsgroup answers questions about using macros in MS Access relational
database software (and, aside from being in a different software product,
macros in Excel are very, very different from macros in Access).


"Ryk" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have this from surfing here and it not work. What I have is column A
> with headings, and what I copy into this would look something like this
> for example....
> ( Used | to show cells)
>
> Value|of|item|is|45|23|12|blah|23|16
>
> What I need it to end up looking like is...
>
> Value|45|23|12|23|16
>
> It would need look for text in cells and delete those cells and shift
> left over 7-8 columns.
>
> The
> Sub MoveText()
> Dim rCell As Range
> Dim rCheck As Range
> ' either select a column, range or whatever on the sheet or
> ' set a value
> 'set rCheck=selection
> Set rCheck = Range("D115")
> For Each rCell In rCheck
> If IsDate(rCell) Then
> rCell.Offset(0, -1).Delete Shift:=xlToLeft
> End If
> Next
> Set rCell = Nothing
> Set rCheck = Nothing
> End Sub
>
> The " If IsDate(rCell) Then " above I tried changing to " If
> Istext(rCell) Then" but that not work. Ok Ok I am not the brightest
> excel Bulb heheh.
>
> Thanks for any help
>
> Dave
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto-ID and Delete/left shift cells when a cell contains text? IndyToothDoc Microsoft Excel Misc 0 29th Jun 2009 06:06 PM
Shift cells to the left =?Utf-8?B?U3RldmUgRC4=?= Microsoft Excel Programming 4 9th Jul 2007 01:26 AM
Delete cells with text, and shift cells left? Ryk Microsoft Excel Discussion 1 10th Nov 2006 06:40 AM
Move/Shift cells left or right in a row T.Taylor Microsoft Excel Programming 0 14th Nov 2005 03:15 PM
Delete a blank cell and shift left jrb Microsoft Excel Programming 1 26th Feb 2004 09:52 PM


Features
 

Advertising
 

Newsgroups
 


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