Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Forgot the Code

Hi,
I use to have the code for this..
I have 8 cells on a row and only one of the cells on that row may contain
data. I want the rows to right on the ninth coulmn whatever is in the eight
cells to the left

Example:
Blank Blank Blank Yellow Blank Blank blank blank Yellow
blank Red blank Blank Blank blank blank blank Red

Thanks for the help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Forgot the Code

Right click on the Sheet Tab and select View Code. Paste in code like this:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrHandler
If Target(1).Column = 1 And Target(1).Column <= 8 Then
If Not IsEmpty(Target(1)) Then
Set rng = Cells(Target(1).Row, 1).Resize(1, 8)
Application.EnableEvents = False
For Each cell In rng
If Not IsEmpty(cell) Then
If Target(1).Address < cell.Address Then
cell.ClearContents
End If
End If
Next
Cells(Target(1).Row, 9).Value = Target(1).Value
End If
End If
ErrHandler:
Application.EnableEvents = True

End Sub

--
Regards,
Tom Ogilvy

"Duncan_J" wrote in message
...
Hi,
I use to have the code for this..
I have 8 cells on a row and only one of the cells on that row may contain
data. I want the rows to right on the ninth coulmn whatever is in the

eight
cells to the left

Example:
Blank Blank Blank Yellow Blank Blank blank blank Yellow
blank Red blank Blank Blank blank blank blank Red

Thanks for the help



Reply
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
I forgot my password, how do I open a sheet if I forgot the pass Hector Solorzano Excel Worksheet Functions 4 February 20th 13 05:08 AM
Forgot Joe Palazzo Excel Worksheet Functions 4 December 13th 08 09:09 PM
Forgot Password Ravi Excel Discussion (Misc queries) 3 July 24th 08 04:23 PM
forgot password toon Excel Programming 1 July 6th 05 09:40 PM
forgot password toon Excel Programming 0 July 6th 05 12:56 PM


All times are GMT +1. The time now is 07:17 AM.

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"