Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 287
Default Scan range of rows and export to 2nd worksheet

I created a spreadsheet as an entry form. There are 56 rows and 10 columns in
each row.

I want to create a command button that will scan each row and gather the
data, and then it will copy it into another workshet. After completion, it
will clear the first form, but it will not eliminate the formulas in the
fields.

Is this possible??

Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Scan range of rows and export to 2nd worksheet

Hi Adam,

This ought to get you started. Put this code into a module and assign
it to the command button on your data entry sheet.

Sub CopyRows()
Dim lentryRow As Long
Dim ldestRow As Long

' assumes data starts in column A for each row
' find last row with data in the active sheet
lentryRow = Cells(Rows.Count, 1).End(xlUp).Row
' assumes data starts in row 2
Range(Cells(2, 1), Cells(lentryRow, 10)).Copy

' find the first empty row on the destination sheet
ldestRow = Worksheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Row +
1
' append new data
Worksheets("Sheet2").Cells(ldestRow, 1).PasteSpecial _
Paste:=xlPasteValuesAndNumberFormats
' assumes that last 5 cells in data entry form have formulas
' so just clear the actual entry cells
Range(Cells(2, 1), Cells(lentryRow, 5)).ClearContents
End Sub

I hope this helps,

Gary

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I scan in a worksheet so that I can edit or add data? beacon Excel Worksheet Functions 2 February 29th 08 11:26 PM
HOW CAN I SCAN DATA WITH COLUMNS AND ROWS DIRECTLY INTO SPREADSHE. SUFI DARWAISH New Users to Excel 2 April 20th 05 05:15 PM
Examples of VBA code to scan all rows and perform a function conditionally? pjfarley3 Excel Programming 6 March 13th 05 06:09 AM
Please help me to solve auto-scan of worksheet gilbert Excel Programming 2 January 13th 04 06:07 AM
scan rows Jonh Excel Programming 2 August 3rd 03 10:45 AM


All times are GMT +1. The time now is 09:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"