+ Reply to Thread
Results 1 to 11 of 11

New to VBA - want only output in excel worksheet

  1. #1
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    267

    New to VBA - want only output in excel worksheet

    Hello friends,

    I have created an excel file for some automated analysis....

    The problem I am facing is that there are far too many formulae in far too many cells....

    A friend on this forum suggested I should try coding the formulae in VBA to make it easier, the file lighter and processing much faster....

    I understand that the formulae can be written in the macro for example:

    Sub ADD()

    Range("D5").Select
    ActiveCell.FormulaR1C1 = "=RC[-1]-RC[1]"

    End Sub

    But when I do this, the formula is showing in the cell and this does not help in anyway.... because the formula will keep getting typed in every cell and the file will become heavy.... it is the same as typing the formulae in the excel sheet....

    I want only the output to show in the excel sheet.... so that the file become light...

    Can someone help pls.....
    Regards,
    Navin Agrawal

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: New to VBA - want only output in excel worksheet

    May be this?

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: New to VBA - want only output in excel worksheet

    If you want the value instead of formula.
    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  4. #4
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: New to VBA - want only output in excel worksheet

    Quote Originally Posted by bakerman2 View Post
    If you want the value instead of formula.
    Please Login or Register  to view this content.
    Thanks for your revert.... Appreciate it.... A couple of things:

    Will this keep my file light?

    How do I do this for a whole range where cells have different formulae...

    Lemme explain: Cells Q303:JZ602 have different formaulae in random cells.... all cells do not have formulae....

    firstly I want to key in formulae in these random cells (which I will do in the VBA).... but I want only the output to be displayed in the excel sheet.... so do I have to enter .value = .value after each formula in the VBA?

    Once I have done this, I want this block of Q303:KZ602 copied down 200 times.... so that the VBA internally copies down this block 200 times but only outputs are shown in the excel sheet....

    Can u help on This?

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: New to VBA - want only output in excel worksheet

    Q303:JZ602
    That's about 81000 cells.
    How are you gonna program that in VBA ????

  6. #6
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: New to VBA - want only output in excel worksheet

    Quote Originally Posted by bakerman2 View Post
    That's about 81000 cells.
    How are you gonna program that in VBA ????
    basically the formulae keep getting copied down..... the formulae are in only 15000 cells with just about 100 odd unique formulae.... this i will manage... no worries on that....

  7. #7
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: New to VBA - want only output in excel worksheet

    Quote Originally Posted by bakerman2 View Post
    If you want the value instead of formula.
    Please Login or Register  to view this content.
    Will this keep my file light?

    How do I do this for a whole range where cells have different formulae...

    Lemme explain: Cells Q303:JZ602 have different formaulae in random cells.... all cells do not have formulae....

    firstly I want to key in formulae in these random cells (which I will do in the VBA).... but I want only the output to be displayed in the excel sheet.... so do I have to enter .value = .value after each formula in the VBA?

    Once I have done this, I want this block of Q303:KZ602 copied down 200 times.... so that the VBA internally copies down this block 200 times but only outputs are shown in the excel sheet....

    Can u help on This?

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: New to VBA - want only output in excel worksheet

    Every formula you put in your sheet with VBA has to be calculated first before you can 'fix' it's output.
    I don't see the advantage you're gonna get by doing it this way.
    Formulas are usually faster then VBA so it's no help calculating everything in VBA and pasting to worksheet.
    Maybe your formulas can be enhanced so they calculate faster.

  9. #9
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: New to VBA - want only output in excel worksheet

    What do you suggest I do in that case?

  10. #10
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: New to VBA - want only output in excel worksheet

    There are some real wizards in Formulas & Functions forum so you may want to have them take a look at your formulas.

  11. #11
    Forum Contributor
    Join Date
    03-15-2012
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    267

    Re: New to VBA - want only output in excel worksheet

    thanks for your suggestion... do let me know if u can think of a solution

+ 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. Replies: 1
    Last Post: 01-14-2016, 01:29 PM
  2. [SOLVED] Take input from one worksheet and display output in another worksheet
    By Alka Yadav in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 06:10 AM
  3. Parsing/Separating Excel Worksheet into Multiple Output Files
    By Obibielebongnobi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-11-2014, 03:30 PM
  4. Randomly sample 30 columns from worksheet input and print them in worksheet Output
    By Savan87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2012, 01:00 PM
  5. Why won't my function output to worksheet?
    By PingPing in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-21-2011, 06:25 AM
  6. Userform output to worksheet: row movement
    By ilovelagar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2009, 05:33 PM
  7. [SOLVED] How do I output the worksheet name in cell?
    By Sloth in forum Excel General
    Replies: 3
    Last Post: 07-08-2005, 07:05 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