+ Reply to Thread
Results 1 to 3 of 3

Non active cell non active sheet copy row from cell refference.

  1. #1
    Registered User
    Join Date
    06-23-2016
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    10

    Non active cell non active sheet copy row from cell refference.

    I am stuck on some (probably simple) VBA syntax. I am a PowerShell guy so VB is a bit foreign to me...
    I find a cell of interest on another sheet and then I am copying the contents via an offset to a next free cell in a given column on the active sheet.
    What I would actually like to know is two things.

    1. How do I select all the cells which are populated from the same row as the .find function returns, into the range Variable named 'cell' ? There will be around five or six adjacent cells which are populated.
    2. How do I specify a starting row as well as a column for the destination section of the copy function?

    Things I tried for problem #1 range(cell).select.row.copy _ 'wouldn't that be nice. Doesn't work.
    .Range.("cell").row.select.copy _ ' also not working.
    I tried injecting additional copy lines into the DO loop to copy the adjacent cells as well. But some of the adjacent cells are empty and the row structure needs to be preserved as is. This means on destination the data gets out of sync. Hence the need to do it as an atomic operation.

    For #2 I want to be able to express something like Destination = D5 and find the next free cell in column D. i.e. don't write into the top five cells even if they are empty. If I select all the populated cells from the source, I need to make sure it wil just auto fill from D5 into the next free row and out to the right, not overwrite to the left.

    Here is the code which I am using... (typed manually from another system)

    Please Login or Register  to view this content.
    So everything is about this line
    Please Login or Register  to view this content.
    Thanks in advance for the gems.

  2. #2
    Registered User
    Join Date
    06-23-2016
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    10

    Re: Non active cell non active sheet copy row from cell refference.

    Have I asked something, too easy, or too hard?

  3. #3
    Registered User
    Join Date
    06-23-2016
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    10

    Re: Non active cell non active sheet copy row from cell refference.

    The answer I discover is to use offset resize like this.

    Cell.Offset(0, -3).Resize(1, 4).Copy _

    The offset resize are specific to my find query and data set.

+ 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. [SOLVED] Copy row of active cell to another sheet
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2015, 03:58 PM
  2. Copy Active Cell Row and insert below Active Cell Row
    By amartin575 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-09-2015, 02:40 PM
  3. Replies: 4
    Last Post: 07-03-2015, 04:27 AM
  4. [SOLVED] save active sheet in new workbook, naming it as cell value of active sheet
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2014, 06:16 AM
  5. copy next cell when excel sheet active
    By anilg0001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-06-2013, 06:52 AM
  6. I need to sort an active sheet using the col of the active cell
    By HamFlyer in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2006, 02:30 PM
  7. [SOLVED] Copy from active sheet and paste into new sheet using info from cell in active
    By Ingve in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2006, 06:00 PM

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