Data entered in one record is shifting to others

I have a large spreadsheet that is attempting to track folk's location over 
the next few months.

Columns A thru AE are data type entries....columns AF thru IU are date 
ranges. I am tracking/have entered over 300 records/rows.

I have had some previous help on coding to shade the interior of the date 
cells based on what text entry that I make in the cell.  Unfortunately, I 
didn't think of or ask for the code to return the cell interior color to 
white when i deleted the text entry...so I tried working the code so that it 
would.  Well, it does, but only for one cell at a time.  Any 
ideas????????????????? 

Secondly, I will enter text into the date range cells, and they will 
interior shade to the correct color.  What I am noticing is that the text 
entries into the date range cells will then "migrate" to other (row) 
cells....causing my spreadsheet to be worthless.  

At first I thought that I was causing it by using the auto filter function 
and then cutting and pasting the date range text entries.  So I quit using 
the auto filter function to enter data...I only used it to view data.

Then I would use the sort function to set up a view that worked for me, then 
I would enter the data one record at a time...and it appeared that the data 
was not migrating into other (row) cells.

So now that I have built formulas and graphs...I go back and take a look at 
the base spreadsheet...and find that the data has migrated!!!!!!!!!!!!!!!

I am tracking over 300 people...from Feb thru Sep....and the "calendar" 
spreadsheet is worthless if data keeps migrating!!!

I am not sure what is causing this!!!  Is it the Excel application 
itself...or is it the code that I am using to change the interior color of 
cells with text entries?????

Would appreciate it if someone could look, yet again, at the coding I am 
using.  Here it is:

Private Sub Worksheet_Change(ByVal Target As Range)
  Const colorGray40 = 48
  Const colorRed = 3
  Const colorBlack = 1
  Const colorSeaGreen = 50
  Const colorBrightGreen = 4
  Const colorTurquoise = 8
  Const colorYellow = 6
  Const colorLavender = 39
  Const colorLightOrange = 45
  Const colorWhite = 2
  Const colorViolet = 13

  If Target.Cells.Count > 1 Then
    Exit Sub
  End If
  Select Case UCase(Trim(Target))
    Case Is = "DB"
      Target.Interior.ColorIndex = colorGray40
      Target.Font.ColorIndex = colorGray40
    Case Is = "DN"
      Target.Interior.ColorIndex = colorBrightGreen
      Target.Font.ColorIndex = colorBrightGreen
    Case Is = "DS"
      Target.Interior.ColorIndex = colorSeaGreen
      Target.Font.ColorIndex = colorSeaGreen
    Case Is = "DO"
      Target.Interior.ColorIndex = colorTurquoise
      Target.Font.ColorIndex = colorTurquoise
    Case Is = "DJ"
      Target.Interior.ColorIndex = colorRed
      Target.Font.ColorIndex = colorRed
    Case Is = "HH"
      Target.Interior.ColorIndex = colorYellow
      Target.Font.ColorIndex = colorYellow
    Case Is = "PCS"
      Target.Interior.ColorIndex = colorViolet
      Target.Font.ColorIndex = colorViolet
    Case Is = "PG"
      Target.Interior.ColorIndex = colorLavender
      Target.Font.ColorIndex = colorLavender
    Case Is = "LV"
      Target.Interior.ColorIndex = 1
      Target.Font.ColorIndex = 1
    Case Is = "TD"
      Target.Interior.ColorIndex = 45
      Target.Font.ColorIndex = 45
     Case Is = ""
      Target.Interior.ColorIndex = 2
    Case Else
      'do nothing
  End Select
End Sub

thanks in advance!

patrick

0
12/29/2008 7:07:01 PM
excel.newusers 15348 articles. 2 followers. Follow

1 Replies
497 Views

Similar Articles

[PageSpeed] 36

Patrick,

For the first part, change

  If Target.Cells.Count > 1 Then
    Exit Sub
  End If

to

Dim myC As Range

  If Target.Cells.Count > 1 Then
    For Each myC In Target
    If myC.Value = "" Then
        myC.Interior.ColorIndex = 2
    End If
    Next myC
    Exit Sub
  End If

For the other part, I'm really not sure what you mean by the data migrating - there is nothing in 
the code that would move values.

HTH,
Bernie
MS Excel MVP


"shekpatrick" <shekpatrick@discussions.microsoft.com> wrote in message 
news:6B6DB339-51BF-4D3D-9D55-0184531BA639@microsoft.com...
>I have a large spreadsheet that is attempting to track folk's location over
> the next few months.
>
> Columns A thru AE are data type entries....columns AF thru IU are date
> ranges. I am tracking/have entered over 300 records/rows.
>
> I have had some previous help on coding to shade the interior of the date
> cells based on what text entry that I make in the cell.  Unfortunately, I
> didn't think of or ask for the code to return the cell interior color to
> white when i deleted the text entry...so I tried working the code so that it
> would.  Well, it does, but only for one cell at a time.  Any
> ideas?????????????????
>
> Secondly, I will enter text into the date range cells, and they will
> interior shade to the correct color.  What I am noticing is that the text
> entries into the date range cells will then "migrate" to other (row)
> cells....causing my spreadsheet to be worthless.
>
> At first I thought that I was causing it by using the auto filter function
> and then cutting and pasting the date range text entries.  So I quit using
> the auto filter function to enter data...I only used it to view data.
>
> Then I would use the sort function to set up a view that worked for me, then
> I would enter the data one record at a time...and it appeared that the data
> was not migrating into other (row) cells.
>
> So now that I have built formulas and graphs...I go back and take a look at
> the base spreadsheet...and find that the data has migrated!!!!!!!!!!!!!!!
>
> I am tracking over 300 people...from Feb thru Sep....and the "calendar"
> spreadsheet is worthless if data keeps migrating!!!
>
> I am not sure what is causing this!!!  Is it the Excel application
> itself...or is it the code that I am using to change the interior color of
> cells with text entries?????
>
> Would appreciate it if someone could look, yet again, at the coding I am
> using.  Here it is:
>
> Private Sub Worksheet_Change(ByVal Target As Range)
>  Const colorGray40 = 48
>  Const colorRed = 3
>  Const colorBlack = 1
>  Const colorSeaGreen = 50
>  Const colorBrightGreen = 4
>  Const colorTurquoise = 8
>  Const colorYellow = 6
>  Const colorLavender = 39
>  Const colorLightOrange = 45
>  Const colorWhite = 2
>  Const colorViolet = 13
>
>  If Target.Cells.Count > 1 Then
>    Exit Sub
>  End If
>  Select Case UCase(Trim(Target))
>    Case Is = "DB"
>      Target.Interior.ColorIndex = colorGray40
>      Target.Font.ColorIndex = colorGray40
>    Case Is = "DN"
>      Target.Interior.ColorIndex = colorBrightGreen
>      Target.Font.ColorIndex = colorBrightGreen
>    Case Is = "DS"
>      Target.Interior.ColorIndex = colorSeaGreen
>      Target.Font.ColorIndex = colorSeaGreen
>    Case Is = "DO"
>      Target.Interior.ColorIndex = colorTurquoise
>      Target.Font.ColorIndex = colorTurquoise
>    Case Is = "DJ"
>      Target.Interior.ColorIndex = colorRed
>      Target.Font.ColorIndex = colorRed
>    Case Is = "HH"
>      Target.Interior.ColorIndex = colorYellow
>      Target.Font.ColorIndex = colorYellow
>    Case Is = "PCS"
>      Target.Interior.ColorIndex = colorViolet
>      Target.Font.ColorIndex = colorViolet
>    Case Is = "PG"
>      Target.Interior.ColorIndex = colorLavender
>      Target.Font.ColorIndex = colorLavender
>    Case Is = "LV"
>      Target.Interior.ColorIndex = 1
>      Target.Font.ColorIndex = 1
>    Case Is = "TD"
>      Target.Interior.ColorIndex = 45
>      Target.Font.ColorIndex = 45
>     Case Is = ""
>      Target.Interior.ColorIndex = 2
>    Case Else
>      'do nothing
>  End Select
> End Sub
>
> thanks in advance!
>
> patrick
> 


0
Bernie
12/30/2008 7:51:14 PM
Reply:

Similar Artilces:

Problems migrating BCM data into CRM SB edition
Hi There I am having a problem migrating data from Business Contacts Manager (BCM) into CRM 3.0 Small Business edition. I have downloaded the BCM data migration pack and have followed the data migration documentation to the letter. I even cleaned up the BCM database prior to copying the files, checking them for errors using the Manage Database option in the Business Tools menu. It gets so far through the migration process and then bombs out. Here is the final few entries from the log file: 28/10/2006 12:18:53------>Transitioning to next screen. From: ConfigurationSummary screen. To: ...

double clicking and draging a column in a chart to chg data
in Excel 2003, double clicking on a column in a chart and then dragging the column up or down would change the data in a table upon which the chart depended. How does one do this in excel 2007? Tom Hi, That feature has been removed in 2007, there is no way to do it. If this helps, click the Yes button. -- Thanks, Shane Devenshire "Tom of inns" wrote: > in Excel 2003, double clicking on a column in a chart and then dragging the > column up or down would change the data in a table upon which the chart > depended. > > How does one do this in excel 2007? &g...

transfer data from multiple columns to singlr column
I have data in form a d g b e h c f i (but larger scale) and I need it in a single column going a to z. Hi, highlight you data, copy, go to the column where you want to see the data, paste special, transpose "lc85" wrote: > I have data in form a d g > b e h > c f i (but larger scale) > and I need it in a single column going a to z. You up for using a macro? Sub ToOneColumn() 'dantuck Mar 7, 2007 &...

Can't open 2005 data file after reinstalling Money 2005
I am experiencing a recurring problem. I have had to reinstall Windows XP and MS Money 2005. I am now unable to open my previously converted 2005 file or restore any backup version. I consistently get the following error message: "Money cannot locate filename or cannot open it, possibly because it is a read-only file, you do not have permission to change it, or your disk drive is write- protected. If you have chosen the correct file and it cannot be accessed, you will need to click OK and then Restore your most recent backup file." Any help or thoughts would be greatly ap...

OWA jumping mouse
I have two computers on my network that are having an interesting issue. When they are creating a message and typing away in the body of the message, randomly when they hit a key, any key, they system will act as if the mouse was clicked. If the mouse is over the send button, it would have sent the email. If the mouse was over the start button, the start menu would have come up. Where ever the mouse was left at, it will act as if it was clicked. It is very random but often. This only happens in OWA, not in outlook or any other place. Both systems are running XP pro SP2 with IE 6 SP2. ...

Macro for Sharepoint List and another Table?? Same # records?
I am creating a database which we have a form made up of prepopulated data (from a sharepoint list) and also data input needed by a user (for example, comments, etc.). I have two tables: one sharepoint list that is linked to sharepoint website and another table that houses the additional user inputs [table 2]. I have linked the files based on the primary key. So, every record in my table 2 has a plus sign and it will expand and you will see the linked data from the sharepoint list. Is there a way that I can automatically create a record for every corresponding record ...

changing values of one field based on another
How can I best change the values of one field in a table based on values of another field of the same table. We have an existing table of thousands of entries and I would like to use the following logic to populate a new boolean field. If field1 = "Done" Then BooleanFieldCompleted = True I have some Excel VBA experience but limited Access. I dont want to do this manually! Any assistance appreciated. In general, you'd use an Update query. However, in this case I don't see why you'd need such a field. Why not just create a query with a computed field that returns True...

Copying Data in a cell in one sheet to a cell in another sheet
I've run into a problem trying to copy data from a cell in one sheet to another. I have a spreadsheet called "rating" which contains a number of formula that calculates a final number. I also have a spreadsheet called "Final" that copies over the information from "Rating". In "Final", I'm trying to copy a number from "Rating" into a particular cell. I put in =Rating! G89, but it won't work. When I press enter, a window pops up "Update value:Rating". I press enter again and in the cell where I want the number ...

Customer check data
When customers pay by check RMS asks for specific information such as drivers license number, routing number, account number, address and phone number. Does anyone have a report and or a way to extract this info from the database for cases when the check is returned for NSF? Please advise, Scott We can write you this report. Contact me for detail on price . Afshin Alikhani - [ afshin@retailrealm.co.uk ] CEO - Retail Realm = = = = = = = = = = "Scott Santorio" <scott@tt-newyork.com> wrote in message news:e8ZKkR6$HHA.3716@TK2MSFTNGP03.phx.gbl... > When customers pa...

Macro to seperate data
Hi I seem to be struggling to find a macro that will work in previous threads. In sheet 1 is a list of data in columns A:N and the number of rows will vary. It is a list of sales with each sale record ocuppying one row. The salesperson's name is in column C and each salesperson will have multiple entries. What I am trying to do is create a seperate summary sheet in the workbook for each salesperson. Therefore sheets 2 to 20 are templates that already exist with a different salesperson's name entered into cell C3 on each of them. I am trying to find a macro that ...

Need HELP! for Linking data
Could someone please direct me to where I can learn how to link date in a work book. i.e., I have individual pages for each subject but I need the data that is entered in these individual pages to transfer to the Master page without having to manually in put it.........TNX Bubey, There are not too many bits about linking worksheets or workbooks that I can find. But have a look at the links below, in case they give you the information you need. I think it is frustratingly one of those things which is very easy when you know how, or if you can get someone to actually show you, but if you hav...

Macro
I need a macro that help me to transfer name and address information from an specific table in excel to a template in words on specific areas and then print the word document. The reason for this is that i need to create diferents letters to be sent to the customers from the excel table. Example of the table is: soc seg, customer name, child name, customer code, add 1 , add2, city, estate, zip code. all this information will be paste on word letter template on specific areas or fields. Any suggestion!!! -- nicoro Hi IMHO the best approach would be to set up a mail merge documen...

macros entering data
How do I create a macro that goes to one cell then waits until I enter new data, then goes to another cell and waits until I enter new data etc? thanks How about something like sub Enter_Data() dim NewValue NewValue = inputbox("Enter the value for cell A1: ") range("a1").value = NewValue NewValue = inputbox("Enter the value for cell G2: ") range("g2").value = NewValue NewValue = inputbox("Enter the value for cell I8: ") range("i8").value = NewValue end sub ...

Cant read one instance of recurring appointment
The problem we're having is a little different that what I've seen posted. A user randomly gets the message "Cant read one instance of recurring appointment. close any open appointments and try again, or recreate the appointment" several times a day. When you click OK the same message appears several times. Outlook doesn't indicate which recurring appointment is having the problem and the message just pops up at various times even if the user isn't in the calendar. We've deleted the Frmcache file and run the clean profile switch, but that hasn't worked. Has an...

Cell with large amount of data not showing all data
I'm running Excel 97. I have a cell with 358 words (1928 characters with spaces). Word wrap is on for the cell. Only part of the text is displayed even though the cell is big enough to show everything. If I make the cell wider (wider than a page) more of the text shows but not everything. I tried a new worksheet with the same text and had the same problem. Is this a known issue with excel? Is there a solution? Thanks, Brad Left to its own devices, excel will only show about 1000 characters in a cell. But you can add some alt-enters (to force a new line within the cell) and see more s...

me too, problem with import... only 15 records
me too, problem with import... only 15 records.... also in one of my customers crm i need a fast answer.... I dont see a question to answer...? JUAN MARKETING wrote: > me too, problem with import... only 15 records.... also in one of my > customers crm > > i need a fast answer.... Hehe yeah, what is the question!? what are you trying to import? Sorry, I don't know the reason, bu each time i try to import x number of accounts or contacts, MSCRM only import 15 records... Promise, everything is ok... columns, format csv from excel, size, records.... I say that, becau...

Determine a result of one column based on conditions in two column
Example Col A Col B Count the number of a's in Col B only when an x is in Col A x a x a Result should be 2 y a z p I can't figure it out x t x m Thanks try this =SUMPRODUCT(--(A2:A7="x"),--(B2:B7="a")) -- Hope this help Please click the Yes button below if this post have helped answer your needs Thank You cheers, francis "tel703" wrote: > Example > Col A Col B Count the number of a...

Exchange 2003, Two Sites, Two Smarthosts, One Domain, No Internal mail!!
Hi, I hope there is someone out there who can point me in the right direction. We have two sites, Brisbane and Sydney, connected by a frame realy connection. Sydney is currently running exchange 2003 (upgraded by migration from exchange 5.5 about a month ago). Brisbane is currently running their mail through sendmail and sendmail only. We have just installed exchange 2003 on server 2003 box in Brisbane and are trying to get the two sites working in two routing groups. The topology will be the same in both Brisbane and Sydney, in that each city will have an external mail server running sendma...

Subquery
Hi, I'm trying to code a subquery on a table but to no avail...it's a very simple table that has Date (short date, just recording the day) and NAV which is a number (double). All I'm wanting to do is have a query that displays the Date, the NAV and the NAV from the day before - only recording business dates. In other words, the subquery number I want is the NAV from the record preceeding the current one. I've got as far as the below, but that just gets the same NAV number as today's: SELECT tblNAV.Date, tblNAV.NAV, (SELECT LAST(x.NAV) FROM tblNAV as X LEFT JOIN tblNAV on...

Start macro creating a mail with contact data and autotext
Hallo, I am working with an user form. The developing of that form started with Outlook XP with a lot of code inside for different buttons. I changed to Outlook 2007 and unfortunately the code of the form was not longer displayed. What I learned about this is that MS does not support to much code in the form (or maybe a bug). They also do not support any longer. I was sending this form to MS support but they told it is do much code inside and they do not know, why the code is not displayed. In Outlook 2003 the code is displayed as in Outlook XP. Because I do not know real...

find data and autopaste when found
Hi, Can someone help me how to do this : For checken the backorders of our customers we can extract a list fro our SAP system. this list is always different and shows us ever product per customer in Back order. ex. Customer A has product 1 en in backorder. This gives 2 lines in the xls file. can excel put th name of the customer on a form and it's backorders automatically. Ca it create for each customer showing in the list a new form? thanks koenraa -- Message posted from http://www.ExcelForum.com ...

copy values generated by conditional formula in one sheet to the other work sheet as values
Hi Everybody, I have data generated by conditional formulae in work sheet1 in columns A to J. If the condition is satisfied the cell will display a realnumber, if the condition doesn't satisfied the cell will display the text"FALSE". Now I wanted to copy the cells which have the real numbers in sheet1 to sheet2 as values(as we do with paste special and paste the values) Do we have any formula or other method to copy the cells in sheet1 to sheet2. can anybody helpme out in this issue. Thanks and Regards Ramana Select your range to copy edit|goto|special|c...

Disappearing data in sync'd forms
I have a small sized text box in a form called frmMain. This text box may or may not contain a large amount of text. If the text box does contain alot of text I want to open up a new form called frmLargeText that contains a larger text box to allow the user to easily see and edit the large amount of text. I also need the two forms to stay in sync. i.e. if the user moves to a new record then both forms move to the same record. I thought I could do this by setting the recordset of frmLargeText to equal the recordset of frmMain as follows: Dim frm as Form_frmLargeText Dim rst As DAO.Rec...

Entering More than 15 numbers
I'm trying to import numbers that are 25 characters in length. When I do this (or even if I enter over the 15 character limit) I get an overflow number. How do I enter or import numbers greater than 15 digits and have it display the entire number. I am using Office XP. precede with an apostrophe to get text, Excel's limit for numbers is 15 digits precision -- Regards, Peo Sjoblom "Mike" <anonymous@discussions.microsoft.com> wrote in message news:308101c428be$93500a10$a101280a@phx.gbl... > I'm trying to import numbers that are 25 characters in > lengt...

Calculating Subsets of Data
I have data for records that can span between 1 to 16 months.. I want to be able to calculate the average activity for the most recent six months in a query and be able to display that in a report. I can create the calculation in the query for the entire duration of months for each record but am stuck on how to have it choose only the most recent six months of data to do the calculation and understand that the six months may really only be between 1 to 6 months of data.. Any suggestions would be greatly appreciated..My skill level is somewhere between meatball surgeon and ki...