LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Activecell offset value with formula?

ooppss!

I had just switched from cell formulas, need to convert to VBA using
"WorksheetFunction." in front of a worksheet function, otherwise get your
error message.

..Range("L2").Value = WorksheetFunction.Workday(ActiveCell.Offset(0,
-2).Value, -1)

(certain functions are not repeated in VBA because you can simply call tehm
with the WorksheetFunction prefix)
"Dave" wrote:

Thanks for the reply.

I tried to use
..Range("L2").Value = Workday(ActiveCell.Offset(0, -2).Value, -1)

I get a Compile Error Sub or Function not defined?

The copy procedure is part of a loop? macro below
It loops the list of dates plugs the date to "L2"
downloads some information from that date, copys back
that info and goes to the next date to do the same.

I barley know what I'm doing

Thanks

Sub macro()
Do

On Error Resume Next

Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False

Sheets("Sheet1").Activate
If ActiveCell.Column = 4 Then
With Sheets("~DATA~")
.Range("L2").Value = Workday(ActiveCell.Offset(0, -2).Value,
-1)
.Range("K2") = Trim(ActiveCell.Offset(0, -3))
End With
Else: GoTo LineEnd
End If

Sheets("~DATA~").Select


(more macro)

Sheets("Sheet1").Select

ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))

LineEnd:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub


 
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
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
activeCell.offset in another worksheet François Excel Programming 2 February 25th 05 09:13 AM
Activecell Offset Mark Excel Programming 2 December 7th 04 04:57 PM
ActiveCell.Offset w/ VBA Bob Umlas[_3_] Excel Programming 2 September 4th 04 02:58 PM
activecell offset rvik Excel Programming 1 December 24th 03 07:47 AM


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