Copy and paste

Darren Smith

Well-known Member
Joined
Nov 23, 2020
Messages
631
Office Version
  1. 2019
Platform
  1. Windows
Hi All

Can someone tell me why this code below is not working.
I think it copies ok but won't paste into merged cells.
It's copying from merged cells to merged cells in separate worksheets.

VBA Code:
If ListBox4 = "Add Data to Jobcard Analysis Sheet" Then
   
   Dim wsSource    As Worksheet
   Dim wsDest      As Worksheet
   
   Set wsSource = ThisWorkbook.Sheets("Job Card Master")
   Set Dest = ThisWorkbook.Sheets("Job Card with Time Analysis")
   
        wsSource.Range("G2").Copy
        wsDest.Range("G2").PasteSpecial xlPasteValues
        
       
    End If
End Sub
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
On both spreadsheets E & F, I & J columns are merged
None of that has anything to do with column A which the code is operating on so should be irrelevant.

Can you post small sample data for column A from 'Job Card Master' with XL2BB?
 
Upvote 0
1UNDERFRAME#6393-4400Runner - CH51640028.00ORDERService Metals
72.00​
144.00​
31.232​
#6362-2114Bearer - C3023507ORDERService Metals
17.20​
120.40​
18.918​
6105-5050Blade angles 50 x 50 x 5 Ali19514Stock
0.68​
9.52​
3.440​
0237-7062Mounting bracketsATEGO KIT12Stock
1.21​
14.52​
9.600​
0245-6753Springs - YELLOW4Stock
3.25​
13.00​
0.000​
2WINGS0817-3110Plastic flat topsinglesn/a
7.25​
0.000​
0857-0912Mudflaps9"n/a
2.36​
0.000​
3BULKHEADPanel - CPR142276X218212.00ORDERCarlier
117.45​
117.45​
#6915-5000Pillars - CP15B22542ORDERService Metals
15.61​
31.22​
9.377​
#6461-6100Rave - MS2P21801ORDERService Metals
11.76​
11.76​
3.270​
Bearer 100 x 50 x 2.5 Galv22741Fab Shop
8.49​
8.49​
 
Upvote 0
Sorry, can`t seem to activate XL2BB on my excel spreadsheet. Is this any help above
 
Upvote 0
Sorry, what I need is not just column A but the range from ("A13:N13") down to the bottom of the sheet.
 
Upvote 0
Upvote 0
Hi Peter,

With xl2bb I can`t find it in the add inn section of the excel worksheet
It`s "Job Card Master" Sheet
The sheet above Starts A13 to N13 down

I`ve had success in copying the sheet "Job Card Master" Range ("A13:N299") but for some reason, it will not paste in Sheet"Job Card with Time Analysis"
See below

- error message? (what is the error message?) : CommentThreaded : <Application-defined or object-defined error> : CommentThreaded
- pastes the right thing in the wrong place? (details?) No paste
- pastes the wrong thing in the right place? (details?) No paste
- does nothing? Yes correct
- etc Copies but no paste

VBA Code:
If ListBox4 = "Add Data to Jobcard Analysis Sheet" Then

  Dim wsSource    As Worksheet
  Dim wsDest      As Worksheet
  Dim RngwsSource As Range


  Set wsSource = ThisWorkbook.Sheets("Job Card Master")
  Set wsDest = ThisWorkbook.Sheets("Job Card with Time Analysis")
  Set RngSource = wsSource.Range("A13:N288")


    With wsSource
    RngSource.Copy
    End With
    wsDest.Range("A13").Paste

End if

End Sub
 
Upvote 0
With xl2bb I can`t find it in the add inn section of the excel worksheet
After you downloaded, where did you save the file: xl2bb.xlam?


The sheet above Starts A13 to N13 down
That doesn't compute for me. A:N is 14 columns but I can count 15 columns in post 23


- error message? (what is the error message?) : CommentThreaded : <Application-defined or object-defined error> : CommentThreaded
So there are threaded comments in the copied area of 'Job Card Master'?
If so, in what cell(s)?
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top