+ Reply to Thread
Results 1 to 5 of 5

VBA to copy text

  1. #1
    Registered User
    Join Date
    03-14-2008
    Posts
    45

    VBA to copy text

    This is a really basic question -

    I want to use VBA to paste a string of text, which is an excel formula, into a cell.

    For example, I wan to create a macro that pastes "=IF(AND(SUM(L94:O94)>0,D94=""),1,0)" into cell E30.

    What is the syntax I should use?

    Also, for questions like these is there a good syntax reference that anyone would recommend?

    Thanks!

    Andrew
    Last edited by adr150; 03-11-2010 at 07:18 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: VBA to copy text

    Hi Andrew,

    You would use:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: VBA to copy text

    Hi Andrew,

    Paul's shown an example of the syntax in this case, for other syntax questions, I recommend recording a macro ([alt + t + m + r]) of when you complete the actions manually & then reviewing the code in the VBE. This is probably the best way of learning syntax. Once you have the recorded code, you can highlight a word in the VBE & press [F1] to open up the Help files which will give you more info - you should be able to solve many/most of your syntax issues this way w/o even opening your browser

    hth
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

  4. #4
    Registered User
    Join Date
    03-14-2008
    Posts
    45

    Re: VBA to copy text

    awesome, thanks!

  5. #5
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243

    Re: VBA to copy text

    I'm pleased we could help - thanks for the feedback & marking the thread as Solved

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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