LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Macro Code not reliable

I use the following code behind a command button to populate a "SignOutLog"
worksheet from about 35 worksheets in a workbook containing about 45
worksheets:
Sub SignOutLog()
'
' MakeSummary Macro
' Macro created 6/12/2006 by Maniac
'

'
Sheets("SignOutLog").Select
' Clear the existing values (if any)
Range("$A$2:$p$60").Value = " "
' J tracks the row number on the summary page
' I tracks the sheet number being processed
j = 2
For I = 2 To Sheets.Count
a$ = Sheets(I).Name
' Don't process a sheet if its name Other than "SignOutLog"
' or if the name is blank.
If (a$ = "Birthday") Then GoTo 10
If (a$ = "DepositRecord") Then GoTo 10
If (a$ = "MailLabels") Then GoTo 10
If (a$ = "PmtSummary") Then GoTo 10
If (a$ = "Templat") Then GoTo 10
If (a$ = "ID") Then GoTo 10
If (a$ = "SignOutLog") Then GoTo 10
If (a$ = "DepositRecord") Then GoTo 10
If (a$ = "Photos") Then GoTo 10
If (a$ = "Volunteers") Then GoTo 10
If (Sheets(a$).Range("$C$1").Value = "") Then GoTo 10
' Process the current sheet
Range("g" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C3"
Range("e" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C4"
Range("f" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R6C14"
Range("k" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R9C9"
Range("h" + Format(j)).FormulaR1C1 = "='" + a$ + "'!R44C11"

j = j + 1
10 Next I
End Sub

The code has always worked great until I added the last line --- Range("h"
+ Format(j)).FormulaR1C1 = "='" + a$ + "'!R44C11" --

Now when I run the macro I get the formula in the cell rather than the
value. To be more precise, I get the formula the second time I run the
code. The first time I push the command button the code runs great. I have
been able to get the code to run properly by formatting the column to
"general," but still the second time I run the code the formula appears in
the cells rather than the value.

Only the new column is doing this. The other 4 columns are displaying the
values each time I run the code.

Very confusing.... Where Have I Gone Wrong??

Hank




 
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
Dir function to check for file not reliable RB Smissaert Excel Programming 6 January 25th 06 05:10 PM
Is Excel reliable ראובן Excel Discussion (Misc queries) 18 August 8th 05 02:26 PM
Excel 97 VBA - CURDIR, not reliable Ricke G Excel Programming 2 July 28th 04 07:52 PM
FAST, RELIABLE, LEGAL MONEY MAKING OPPORTUNITY Vasant Nanavati Excel Programming 1 February 19th 04 03:42 AM
excel 2000 workbook.activate not 100% reliable with alt+tab Gavin Frayne Excel Programming 9 July 24th 03 09:29 AM


All times are GMT +1. The time now is 05:10 AM.

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"