Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
bob bob is offline
external usenet poster
 
Posts: 16
Default Macro to insert copy and insert formulas only to next blank row


I have a form with data on ws2 that is transferred to ws1 with
completed. When copied to ws1, it is copied to first empty row based
on the content of column 3.


To accomplish, I have used the following code to find first empty row
and then begin to copy data to that row.


===========================


'find first empty row in database
CellRow = ws1.Cells(Rows.Count, 3) _
.End(xlUp).Offset(1, 0).Row


'copy the data to the ws1
ws1.Cells(CellRow, 3).Value = ws2.[E4].Value
ws1.Cells(CellRow, 4).Value = ws2.[E15].Value
etc..............

==============================

Problem:

Rows 1 thru 255 of ws1 have data in them and row 256 is found by code
to be the "first empty row." Also have a few formulas in several
columns of ws1 in the 255 rows.

Before copying from ws2 to ws1, I would then want to copy row 255,
formulas only, to row 256. Row 256 would still be chosen as first
empty row because column 3 of 256 would still be blank.
I am at row 255 with formulas because of typical copy/paste, but would
like to do automatically with macro.


Thanks




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
insert blank row and formulas scottmcm Excel Worksheet Functions 1 May 5th 10 06:44 PM
Macro: Insert Blank Row with formulas uses absolute position probl steveb Excel Discussion (Misc queries) 1 June 18th 09 08:08 PM
Macro to insert a row and copy down formulas from row above Sal Excel Discussion (Misc queries) 2 December 3rd 07 05:33 AM
Macro to copy previous row and insert two blank rows dd Excel Discussion (Misc queries) 1 April 30th 07 11:25 PM
Activate a macro to insert a row and copy the formuals from the rows above to the blank row oil_driller Excel Discussion (Misc queries) 1 February 11th 05 03:30 PM


All times are GMT +1. The time now is 06:24 PM.

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"