+ Reply to Thread
Results 1 to 3 of 3

Need Help Converting Formula to VBA Code

  1. #1
    Registered User
    Join Date
    08-01-2019
    Location
    Calgary
    MS-Off Ver
    10
    Posts
    2

    Need Help Converting Formula to VBA Code

    Hi All,

    I have been using these sub-array formulas quite frequently and have no issues with them in day to day usage. I am however trying to write a macro that will automatically create a new section in my excel file, and all formulas will automatically be input into their respective cells. Below is an example of the formula I'm currently struggling to get VBA to automatically input. I have highlighted the two functions that I am incapable of capturing in my VBA code, my gut tells me it's probably some sort of loop...

    Ultimately, if my new section possesses 5 rows, the two highlighted sections should grow in order of magnitude of 1. i.e:

    Row 1: Functions should = Rows($1:1) & Row(1:1) respectively
    Row 2: Functions should = Rows($1:2) & Row(2:2) respectively
    Row 3: Functions should = Rows($1:3) & Row(3:3) respectively

    etc...

    Please Login or Register  to view this content.

    If something is unclear or you need additional information please let me know. Thank you in advance for all the help!

    Thank you,

    Konrad
    Last edited by Robotrixx; 08-02-2019 at 11:36 AM. Reason: solved

  2. #2
    Valued Forum Contributor PaulSP8's Avatar
    Join Date
    11-21-2017
    Location
    Chorley, England
    MS-Off Ver
    2013 & 2021
    Posts
    437

    Re: Need Help Converting Formula to VBA Code

    You could do with uploading a Sample workbook (Go Advanced > Manage Attachments) with some sample data and the Code you have already.

    It sounds like might be able to use Autofill to avoid a loop, you do that with something like;

    Please Login or Register  to view this content.
    If you've got the last row of the range stored in a variable then change to;

    Please Login or Register  to view this content.
    Other than that it's hard to advise without seeing what you've got already.

    If that doesn't help then upload a Workbook and I dare say someone will be able to get this sorted for you

  3. #3
    Registered User
    Join Date
    08-01-2019
    Location
    Calgary
    MS-Off Ver
    10
    Posts
    2

    Re: Need Help Converting Formula to VBA Code

    Hey!

    Thanks for the idea, I actually managed to make it work with an iteration of your suggestion above, very much appreciated! All formulas are now scrolling through the appropriate "Row" values

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. converting formula to vba code?
    By Alphabex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-02-2015, 12:38 AM
  2. converting a big formula into vba code
    By neowok in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2012, 11:09 AM
  3. Converting Excel formula into VBA code
    By ashraf999 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2012, 05:38 AM
  4. Converting formula to code
    By gavster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2011, 01:28 PM
  5. converting look up formula to VBA code
    By Saky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-14-2011, 10:37 AM
  6. Converting formula to VBA code
    By Saky in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-31-2011, 09:34 AM
  7. Converting formula to a code
    By Saky in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-30-2010, 12:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1