Problem with vba copy paste range of cells

Konrado

New Member
Joined
Jun 17, 2014
Messages
34
Hi

I have problem with my macro. I want to copy and paste a range of cells from one sheet to another. Excels shows fail in line with Worksheets("Data").Range("B14:B" & Lr).Select everytime.

Sub ApprovalListMatrixDone()

'Kopiowanie zakresów między arkuszami


Dim Lr As Long
Dim Lr1 As Long


With Worksheets("Data")
Lr = Cells(Rows.Count, "B").End(xlUp).Row
Lr1 = Cells(Rows.Count, "J").End(xlUp).Row
End With


Worksheets("Data").Range("B14:B" & Lr).Select
Selection.Copy
Worksheets("Report").Range("B1").Select
ActiveSheet.Paste
Application.CutCopyMode = False


Worksheets("Data").Range("J14:J" & Lr1).Select
Selection.Copy
Worksheets("Report").Range("B1").Select
ActiveSheet.Paste
Application.CutCopyMode = False


End Sub
 
AlphaFrog

This code doesn't work because we put the same formula in each cell and we have the same result.

'Trackowanie ścieżki akceptacjisht.Range("F2:AD2500").FormulaArray = _"= UPPER(IFERROR(INDEX(R2C1:R2500C2,SMALL(IF(R2C1:R2500C1=RC5,ROW(R2C1:R2500C1)-1),COLUMNS(RC6:RC)),2),""""))"sht.Columns("F:AD").AutoFit
Use the 1st code example
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,215,043
Messages
6,122,816
Members
449,095
Latest member
m_smith_solihull

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