PC Review


Reply
Thread Tools Rate Thread

ActiveCell.Value just disappears .... ?

 
 
Ray
Guest
Posts: n/a
 
      25th Feb 2008
hi -

I asked this a couple of days ago (see 'PLEASE Help' msg from 22-Feb),
but I wasn't really that clear in what was happening ... so, I'll try
to explain further ... [reduced version of code below]:

The code is designed to check for out-of-sales amounts and copy these
amounts (and the appropriate ancilliary info, ie county_tax) to the
next available row on the Journal sheet. The code appears to run OK
(ie doesn't error out) and, for the most part, does what it's supposed
to. BUT, one line consistently doesn't work properly ...

The first line of the InsertValues code is supposed to enter the
'amount' (a variable assigned in the GetTax code) to the ActiveCell.
Using the Watch Window, I can see that 'amount' holds the correct
value (even when changing macros), but for some reason the value isn't
transferred to the activecell. What would cause this? I've tried
adding additional lines to insert this same value into other sheets,
as a way to check if there was some problem with the value itself ...
but these worked fine. All other variables (ie county_tax) are
inserted correctly.

Any help is greatly appreciated ... this is last piece of an important
project, but being held up by this issue!

TIA,
Ray




Sub GetTax()
Sheets("out-of-state sales").Activate

LineNum = 9
Range("D9").Activate
For LineNum = 9 To 47
If IsEmpty(ActiveCell.Value) = False Then
amount = ActiveCell.Offset(0, 8).Value

Tax = ActiveCell.Offset(0, 1).Value
County = ActiveCell.Offset(0, -2).Value
Sheets("oos").Cells(4, 2).Value = County
CodeNum = Sheets("oos").Cells(4, 3).Value
County_Tax = Sheets("oos").Cells(3, 2).Value
StorePrefix = Sheets("oos").Cells(4, 5).Value
Sheets("Journal").Activate
Range("P75").Activate
Do While IsEmpty(ActiveCell.Value) = False
ActiveCell.Offset(1, 0).Activate
Loop
InsertValues

End If
ActiveCell.Offset(1, 0).Activate
Next LineNum

End Sub

Sub InsertValues()
ActiveCell.Value = amount
ActiveCell.Offset(0, -1).Value = "0"
ActiveCell.Offset(0, -5).Value = StorePrefix 'PJ/SA code
ActiveCell.Offset(0, -6).Value = "CC3000"
ActiveCell.Offset(0, -7).Value = Worksheets("Cover").Range("H7")
'Store #
ActiveCell.Offset(0, -8).Value = Worksheets("Cover").Range("H8")
'Retail Unit
ActiveCell.Offset(0, -10).Value = "3011"
ActiveCell.Offset(0, -11).Value = County_Tax
ActiveCell.Offset(0, 3).Value = County_Tax

Sheets("Out-of-State Sales").Activate
End Sub

 
Reply With Quote
 
 
 
 
michael.beckinsale
Guest
Posts: n/a
 
      25th Feb 2008
Hi Ray,

IsEmpty tests the condition of a variable and if l believe what l am
told is said to be unreliable.

Suggest you change to something like;

If ActiveCell.Value <> "" Then

...........rest of code

Regards

Michael

 
Reply With Quote
 
Ray
Guest
Posts: n/a
 
      25th Feb 2008
Thanks for the suggestion, Michael ... unfortunately, it didn't solve
the issue ...

Any other ideas?


 
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
Top Toolbar Disappears, Text Disappears =?Utf-8?B?UGFtZWx5bg==?= Windows XP Help 1 17th Nov 2007 09:28 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Microsoft Excel Misc 1 2nd Oct 2007 08:05 PM
How to Revert to ActiveCell.Formula = format from ActiveCell.FormulaR1C1 = format Karthik Bhat - Bangalore Microsoft Excel Programming 1 9th May 2007 02:37 PM
Regedit Disappears / Taskmgr Disappears eb Windows XP New Users 1 7th Jan 2005 09:48 PM
how to set activecell? ljb Microsoft Excel Programming 2 18th Nov 2003 04:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:56 PM.