View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Didier Poskin Didier Poskin is offline
external usenet poster
 
Posts: 11
Default Problem pasting a row from a hidden sheet to the first free row on another visible sheet

Hello you all and thank you again for the help I already got in the past.

here is the stuff:
sheet ("POINTDATA") is hidden
sheet("MAP") is visible

depending on NewElem I'm trying to copy row 101,102 or 103 from sheet
("POINTDATA") to the first free row available on sheet("MAP") but I always
get stuck on something

Private Sub CreateElement()

Dim LastRow As String

NbEl = param("Elements") ' returns the number of lines used
LastRow = Format(NbEl + 1) & ":" & Format(NbEl + 1)
....
Select Case NewElem
Case "A"
Sheets("POINTDATA").Rows("101:101").Copy
Sheets("MAP").Rows(LastRow).Select ' here it gives a 1004
error
Selection.Paste
Case "B"
....

furthermore is there a way of doing this without having to use ".select"
because this macro is called from a third sheet where there might be a non
contiguous range selected which I don't want to loose?

Thanks

Didier


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 8/01/2004