Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy to sheet code question

heres my following code form the help of those on here...
now my ? is that if i were to go toa sheet a erase a
report. the code still sends the copied data to its last
used line or (row).
i would have to delete the rows onced used from the
previous report and clear it thru edit menu.
can i put ina empty cell line code or somethign to allow
the reports to "move up " and replace "empty cells"? i
just dont want alot of empty rows if i should erase one
copied data.

any help??

thanks!
m







Sub copy_to_sheet()
copy_to = "Month" & Range("month_val").Value
last_used = Sheets(copy_to).Cells.SpecialCells
(xlCellTypeLastCell).Address
copy_to_address = Rows(Sheets(copy_to).Range
(last_used).Row + 1).Columns(1).Address
If copy_to_address = "$A$3" Then copy_to_address = "$A$1"
Sheets("form").Range("form_data").Copy Destination:=Sheets
(copy_to).Range(copy_to_address)


End Sub



Private Sub Worksheet_Change(ByVal Target As Range)

this_month = 1
dd = Range("start_date").Value
Do While dd < Range("ref_date").Value
dd = 1 + dd
If Day(dd) = 26 Then this_month = 1 + this_month
Loop
Range("month_val").Value = this_month
End Sub
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
VBA code to copy cell contents from one sheet to another Gimp Excel Worksheet Functions 0 February 23rd 07 05:18 PM
VB code to copy sheet format to another sheet ASU Excel Discussion (Misc queries) 12 August 10th 06 02:37 AM
what is the vb code to copy rows from one sheet to another? bxc2739 Excel Discussion (Misc queries) 2 May 25th 06 07:48 PM
Copy Sheet w/o VBA code Ron de Bruin Excel Programming 1 January 20th 04 04:42 PM
Copy form and code question Stuart[_5_] Excel Programming 2 August 17th 03 12:38 PM


All times are GMT +1. The time now is 11:09 PM.

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

About Us

"It's about Microsoft Excel"