Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Date problems

I am trying to get this simple code to work. Basically, i want to set this
up so that if it has been less than 30 days between dates it will return a
value. This is the code:

OpenDate = CDate(TransAmount.Offset(0, -4))
TodayDate = CDate(TransAmount.Offset(0, 12))
If TransAmount.Offset(0, -2) = "C" And DateDiff("d", TodayDate,
OpenDate) <= 32 And TransAmount = 750 Then
TransAmount.EntireRow.Select
Selection.Font.Bold = True
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
TransAmount.Offset(0, -7).Select
ActiveCell.Value = "HOLD"
End If

i keep getting an "object needed" error. Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Date problems

What line of code is highlighted when the error occurs? Is
"TransAmount" always initialized properly?

/ Tyla /


On Apr 12, 5:50 pm, edluver wrote:
I am trying to get this simple code to work. Basically, i want to set this
up so that if it has been less than 30 days between dates it will return a
value. This is the code:

OpenDate = CDate(TransAmount.Offset(0, -4))
TodayDate = CDate(TransAmount.Offset(0, 12))
If TransAmount.Offset(0, -2) = "C" And DateDiff("d", TodayDate,
OpenDate) <= 32 And TransAmount = 750 Then
TransAmount.EntireRow.Select
Selection.Font.Bold = True
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
TransAmount.Offset(0, -7).Select
ActiveCell.Value = "HOLD"
End If

i keep getting an "object needed" error. Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Date problems

Do you have
Dim TransAmount as Range

???

"edluver" wrote:

I am trying to get this simple code to work. Basically, i want to set this
up so that if it has been less than 30 days between dates it will return a
value. This is the code:

OpenDate = CDate(TransAmount.Offset(0, -4))
TodayDate = CDate(TransAmount.Offset(0, 12))
If TransAmount.Offset(0, -2) = "C" And DateDiff("d", TodayDate,
OpenDate) <= 32 And TransAmount = 750 Then
TransAmount.EntireRow.Select
Selection.Font.Bold = True
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
TransAmount.Offset(0, -7).Select
ActiveCell.Value = "HOLD"
End If

i keep getting an "object needed" error. Any ideas?

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
Date problems Gerry[_2_] Setting up and Configuration of Excel 1 September 28th 07 12:42 PM
Date problems Darlene Excel Programming 3 March 21st 07 11:32 AM
Date problems, is it a bug??? R-P Excel Discussion (Misc queries) 4 August 18th 06 03:40 PM
Date Problems Dean[_8_] Excel Programming 5 July 26th 05 08:35 AM
Date problems John[_94_] Excel Programming 4 September 14th 04 03:57 PM


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