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


I have a cell formula -=IF(J61500,500,J61*-1)- that I want to put
into a macro. How would this formula need to be typed in a line of
code.


--
icetrey
------------------------------------------------------------------------
icetrey's Profile: http://www.excelforum.com/member.php...o&userid=20329
View this thread: http://www.excelforum.com/showthread...hreadid=565031

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Formula to VB Code

ACtivecell.Formula = "=IF(J61500,500,J61*-1)"

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"icetrey" wrote in
message ...

I have a cell formula -=IF(J61500,500,J61*-1)- that I want to put
into a macro. How would this formula need to be typed in a line of
code.


--
icetrey
------------------------------------------------------------------------
icetrey's Profile:

http://www.excelforum.com/member.php...o&userid=20329
View this thread: http://www.excelforum.com/showthread...hreadid=565031



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Formula to VB Code

Or do you mean:
With ActiveCell
If Range("J61").Value500 Then
.Value=500
Else
.Value =Range("J61").Value-1
End If
End With

NickHK

"icetrey" wrote in
message ...

I have a cell formula -=IF(J61500,500,J61*-1)- that I want to put
into a macro. How would this formula need to be typed in a line of
code.


--
icetrey
------------------------------------------------------------------------
icetrey's Profile:

http://www.excelforum.com/member.php...o&userid=20329
View this thread: http://www.excelforum.com/showthread...hreadid=565031



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula to VB Code


Thanks. That worked great.


--
icetrey
------------------------------------------------------------------------
icetrey's Profile: http://www.excelforum.com/member.php...o&userid=20329
View this thread: http://www.excelforum.com/showthread...hreadid=565031

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
Need formula or code Sandy Excel Programming 9 April 13th 06 02:14 PM
formula through vb code Jonsson[_48_] Excel Programming 4 September 19th 05 11:30 AM
Help with my code and formula yh73090[_2_] Excel Programming 1 August 30th 04 06:06 AM
Formula or code Jim[_15_] Excel Programming 0 July 9th 03 05:51 PM
Formula or code John Gittins Excel Programming 0 July 9th 03 04:16 PM


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