Range Object

G

Guest

Guest
Dear MrExcel..
I just want to say that I really love your site . I also have a small problem that you might help is solving ..
I would like to run a VBA Code on an excel sheet
1- It should locate all the rows that has data in them
2-after finding all the rows , I want to copy then to another sheet in a different workbook
3-before copying to the other sheet , I want the code to locate the last filled record and then past underneath it (Append)
could you please help .

I have started but could not finish
this is what I did

Dim I As Long
Dim RngDestination As Range
Dim Wkb As Workbook
Dim Wks As Worksheet

Set RngDestination = Wkb("Test for Annuity Daily Adds.xls") _
.Wks("Annuity Rec Feb 2002").Range("A6522")

Range(Selection, Selection.End(xlUp)).Select


For i = Cells(Rows.Count, "A").End(xlUp).Row To i Step -1
Cells(i, "A").EntireRow.Copy Destination:=RngDestination

Next i
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,213,513
Messages
6,114,072
Members
448,546
Latest member
KH Consulting

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