+ Reply to Thread
Results 1 to 10 of 10

copy value of a cell to another cell on another sheet

  1. #1
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Post copy value of a cell to another cell on another sheet

    hi
    i have been given this code

    [ Dim x As Integer [For x = 3 To Sheets("MFR_List").UsedRange.Rows.Count]
    [If Application.CountBlank(Range(Cells(x, 1), Cells(x, 5))) = 0 Then]
    Range(Cells(x, 1), Cells(x, 6)).Copy Sheets("Completed").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)]
    it copies contents of sheet to another sheet works well, now i need to copy just one cell to another sheet to specific location,
    like from sheet "completed" a5 to sheet" invoice" b9 ,and to be upgradable meaning i need to add extra cells later which i would like to try and do myself before asking for help any help wood be good
    cheers colin
    Last edited by cfinch100; 01-28-2013 at 07:50 PM.

  2. #2
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: copy value of a cell to another cell on another sheet

    hi
    can anyone tell me whats happening here have copied from form completed to form invoice it should go on line 26 which it did first now it goes on anyline it wants to eg 50 , 76, 102
    rows , just does not opoulate 26 all the time any help please
    cheers colin
    Attached Files Attached Files
    Last edited by cfinch100; 01-28-2013 at 02:41 PM.

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy value of a cell to another cell on another sheet

    You have many codes on your book
    This code is copying in to completed sheet, not form sheet. Where is the code which is copying in to invoice sheet?
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: copy value of a cell to another cell on another sheet

    hi
    code for invoices form is in userform4 ,
    data comes from mfr_list to completed to stored contracts and also invoice, which is where having problem it will not just populate one row it keeps moving rows ,was trying to populate boxes on invoice sheet but it keeps moving row nos so will not work
    cheers colin

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy value of a cell to another cell on another sheet

    Sorry! I have not idea how to use a code within user form, but if you have a code like the above one, please post it and will have a look at it.

  6. #6
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Post Re: copy value of a cell to another cell on another sheet

    hi
    this is the code to populate invoice sheet its on userform4 but only cotrolled by cmdbutton it populates invoice by macro and then moves data to right boxes

    on invoices sheet
    Please Login or Register  to view this content.
    cheers colin
    Last edited by cfinch100; 01-28-2013 at 07:07 PM.

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy value of a cell to another cell on another sheet

    Colin,
    Please wrap your code with tags.
    Okay,is this line of code which is supposed to copy in to an invioice sheet and is not working as you intended?

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: copy value of a cell to another cell on another sheet

    hi yes this sends to invoice originally at the end offset i set to 26,0 to put it down the sheet then moved them around with the code below those lines
    but as i said it does not just stay on row 26 even if i clear all forms except mfr_list it just moves about
    cheers colin

    have put code tags on using #is that right
    cheers colin
    Last edited by cfinch100; 01-28-2013 at 07:10 PM.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: copy value of a cell to another cell on another sheet

    Colin,
    Yes, I have tested it.
    Reason: The code is looking for the next empty row after the last row on invoice sheet, so it is not going to stay at row 26 if you have data which appear well below row 26 because VBA thinks that your last row is not 26. I think you have two options. If you want the code to start at 26, you need to clear all data below 26, so that VBA will treat your last row as 26.
    If this is not what you want to do, the other option is to use this code:
    This code paste in to a specifc cell in this case it starts at 26(Change to what ever your choice is)
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: copy value of a cell to another cell on another sheet

    hi
    excellent many thanks
    cheers colin

+ 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