Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Help! - Formatting Oddity

I've tried everything I can think of to resolve this problem and suspect it may some obvious rule that I'm overlooking. I have a workbook with several worksheets that contain VBA procedures that make updates from our Help Desk SQL Server database. Some of these worksheets are updated every minute from a clock procedure

Several of these worksheets are for reporting purposes and are updated only by running a procedure from a command button. Here's my problem

On one of these worksheets there is a column that is populated from the SQL database and I have formatted the column cells to be in the Number format. When the Clock procedure is fired, several of these cells in the middle of the column change to a Date format! There are cells above and below that remain in the Number format, it's just these few cells in the middle that change to Date format. Keep in mind that these cells (and worksheets) are not being updated when the Clock procedure fires, only the worksheets with procedures called by the Clock procedure

I have tried changing the format of the cells back to Number and saving the file and it works - until the Clock procedure fires again. Then these cells in the middle of the column change back to Date format. I can't see anything in my code that would cause this to happen and if there was (such as an implicit conversion), wouldn't it change the whole column

I've tried to copy the cells from above into the Date format cells, I've tried clearing everything with the Edit command, I've tried formatting the cells in code before the SQL update is run (but that would happen only if the Report command button was clicked). All to no avail. It changes only until the Clock procedure fires and I'm right back to square one

Can anyone offer something that I may be overlooking? This thing is driving me crazy!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Help! - Formatting Oddity

Annoying, I bet. Why not go with the flow and just add a
couple lines at the end of your procedure to select that
column and format it the way you want it?
-----Original Message-----
I've tried everything I can think of to resolve this

problem and suspect it may some obvious rule that I'm
overlooking. I have a workbook with several worksheets
that contain VBA procedures that make updates from our
Help Desk SQL Server database. Some of these worksheets
are updated every minute from a clock procedure.

Several of these worksheets are for reporting purposes

and are updated only by running a procedure from a command
button. Here's my problem:

On one of these worksheets there is a column that is

populated from the SQL database and I have formatted the
column cells to be in the Number format. When the Clock
procedure is fired, several of these cells in the middle
of the column change to a Date format! There are cells
above and below that remain in the Number format, it's
just these few cells in the middle that change to Date
format. Keep in mind that these cells (and worksheets) are
not being updated when the Clock procedure fires, only the
worksheets with procedures called by the Clock procedure.

I have tried changing the format of the cells back to

Number and saving the file and it works - until the Clock
procedure fires again. Then these cells in the middle of
the column change back to Date format. I can't see
anything in my code that would cause this to happen and if
there was (such as an implicit conversion), wouldn't it
change the whole column?

I've tried to copy the cells from above into the Date

format cells, I've tried clearing everything with the Edit
command, I've tried formatting the cells in code before
the SQL update is run (but that would happen only if the
Report command button was clicked). All to no avail. It
changes only until the Clock procedure fires and I'm right
back to square one.

Can anyone offer something that I may be overlooking?

This thing is driving me crazy!
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Help! - Formatting Oddity

Good point... I guess since this is my first attempt at programming anything I wanted to write as efficient code as possible. I'm also wary of the Clock procedure updates affecting performance. This workbook currently has seven sheets and until I optimized it the sheets would "blink" several times each minute during the Clock procedure update.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Help! - Formatting Oddity

Oh my god! I just tried adding the format code as Larry suggested and it does the same thing! The first run through the code insures that all of the cells are in the Number format. But once the Clock procedure fires then those same cells in the middle of the column change back to a Date format. Even though the format code is in the Clock procedure

What would cause it to do this?!!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Help! - Formatting Oddity

OK, I found another piece to the puzzle. The code to change the number format works if I don't have the worksheet with the problem cells selected. If I am viewing the worksheet when the Clock procedure fires then the problem cells change back to the Date format

I would really appreciate any further suggestions on how to solve this problem.


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
A rounding oddity Bernard Liengme Excel Worksheet Functions 8 December 28th 06 07:07 AM
OFFSET oddity Stuart MacDonald Excel Worksheet Functions 7 October 6th 06 06:55 AM
An oddity if not a bug Harlan Grove Excel Worksheet Functions 21 July 17th 06 05:36 PM
Chart oddity Ron P Charts and Charting in Excel 2 February 16th 06 03:05 PM
Modal oddity Ken McLennan[_3_] Excel Programming 2 May 27th 04 06:49 AM


All times are GMT +1. The time now is 12:12 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"