Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2019, 06:04 AM
Moot70 Moot70 is offline How I convert formua into VBA code I need help Windows 10 How I convert formua into VBA code I need help Office 2019
Novice
How I convert formua into VBA code I need help
 
Join Date: Oct 2019
Location: Oklahoma
Posts: 16
Moot70 is on a distinguished road
Default How I convert formua into VBA code I need help

Code:
=IF('8'!D17,'8'!D17,"NO TEAM")



Thanks You
Reply With Quote
  #2  
Old 10-27-2019, 06:15 AM
jeffreybrown jeffreybrown is offline How I convert formua into VBA code I need help Windows 10 How I convert formua into VBA code I need help Office 2016
Expert
 
Join Date: Apr 2016
Posts: 611
jeffreybrown has a spectacular aura aboutjeffreybrown has a spectacular aura about
Default

Place your cursor in the cell with the formula, turn on the macro recorder, press F2 and then press tab. Now turn off the macro recorder. Open up the VBE and the code will be there.

Or simply, copy and paste (Note: I also adjusted your formula a tad)

Code:
Sub MyFormula()
    Range("D1").Formula = "=IF('8'!D17<>"""",'8'!D17,""NO TEAM"")"
End Sub
Notice, anytime you have quotes in VBA they need to be doubled up.

Also, the first method will record the formula in R1C1 notation.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How I convert formua into VBA code I need help Code to convert numbers to superscript SidCharming Word VBA 2 08-09-2018 08:21 AM
How I convert formua into VBA code I need help VBA code to convert Heading 1, 2, 3 etc. numbering Lady_Laughsalot Word VBA 4 04-18-2018 12:32 AM
How I convert formua into VBA code I need help VBA Code to search for field codes with certain text before the Field code and to change style welcometocandyland Word VBA 4 02-08-2017 06:53 PM
How I convert formua into VBA code I need help Macro to convert table to convert table into iCalendar file? Weboh Word VBA 5 12-10-2016 03:07 PM
how to convert .wps to .doc ret_squid Word 1 08-11-2016 09:03 PM

Other Forums: Access Forums - Senior Forums

All times are GMT -7. The time now is 08:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft