Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to copy data from 1 worksheet and paste it in a
different worksheet. the range will always start with cell C3 and end with a cell in column I. The number of rows vary. How can I accomplish this? Here's what i have so far: Dim lngLastRow As String Dim myStartColumn, myEndColumn As String lngLastRow = myDataSheet.UsedRange.Rows.Count myStartColumn = 3 myEndColumn = myStartColumn + 7 ??? Any help will be appreciated. MDC |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following does the trick for me rather concisely.
Note that the "Find" always finds the last "filled" row on the sheet. The "copy" method used can be preceded by your workbook name when copying to another book... xLastRow = Cells.Find(What:="*", _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row Range("C3:I" & xLastRow).Select Selection.Copy Destination:=Sheets("Sheet2").Range("A1") Hope this helps you out... -----Original Message----- I need to copy data from 1 worksheet and paste it in a different worksheet. the range will always start with cell C3 and end with a cell in column I. The number of rows vary. How can I accomplish this? Here's what i have so far: Dim lngLastRow As String Dim myStartColumn, myEndColumn As String lngLastRow = myDataSheet.UsedRange.Rows.Count myStartColumn = 3 myEndColumn = myStartColumn + 7 ??? Any help will be appreciated. MDC . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
have you tried
range("C1:I" & range("C1").end(xldown).row).copy this should copy the range between C and I from row 1 down to the first row with no data in it. -----Original Message----- I need to copy data from 1 worksheet and paste it in a different worksheet. the range will always start with cell C3 and end with a cell in column I. The number of rows vary. How can I accomplish this? Here's what i have so far: Dim lngLastRow As String Dim myStartColumn, myEndColumn As String lngLastRow = myDataSheet.UsedRange.Rows.Count myStartColumn = 3 myEndColumn = myStartColumn + 7 ??? Any help will be appreciated. MDC . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying a Range of Cells having data only | Excel Worksheet Functions | |||
Copying rules set on a range of cells | Excel Worksheet Functions | |||
Copying A Range of Cells to Another Worksheet | Excel Discussion (Misc queries) | |||
Problem copying formula to range of cells | Setting up and Configuration of Excel | |||
How do I skip blank cells when copying over a range of cells? | Excel Discussion (Misc queries) |