Results 1 to 11 of 11

VBA Copy from another sheet & paste in cell where the formula is

Threaded View

  1. #1
    Registered User
    Join Date
    01-08-2014
    Location
    Sheffield
    MS-Off Ver
    Excel 2003=7
    Posts
    25

    VBA Copy from another sheet & paste in cell where the formula is

    Hi,

    I'm trying to copy a number from a worksheet 2, and paste it into the cell in worksheet 1 where I am inserting the formula.

    This is what I have so far:
    Function Copy_and_Paste(CellCopy As Range)
    
    Dim Sel_Val As Integer
    'user selects cell they want to copy
    CellCopy.Copy
    Worksheets("Main").Range(Copy_and_Paste).Paste
    
    
    End Function
    Currently, when I run it, it tries to paste the value into a random cell in worksheet 2, and when it does it just shows #VALUE!

    Thanks in advance

    UPDATE:

    I currently have the code below which returns a #VALUE! error now into the correct cell:
    Function Copy_and_Paste(CellCopy As Integer)
    
    Dim Sel_Val As Integer
    Worksheets("Mappings").Range(CellCopy).Value = Worksheets("Main").Range(ActiveCell).Value
    
    End Function
    Can I use ActiveCell as i have? :S
    Last edited by ch_abs; 01-16-2014 at 06:28 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to copy a cell range and paste to a new sheet 'n' times where 'n' defined by formula
    By staminaboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2013, 11:39 AM
  2. How to copy data with formula and paste another sheet as paste spl -value only
    By sumesh56 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-14-2013, 09:03 PM
  3. Replies: 7
    Last Post: 12-03-2012, 03:10 AM
  4. Replies: 0
    Last Post: 05-24-2010, 05:17 PM
  5. Replies: 2
    Last Post: 10-15-2009, 10:12 AM

Tags for this Thread

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