Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Problem pasting a row from a hidden sheet to the first free row on another visible sheet

Didier,

This will replace your .Copy, .Select, .Paste lines of code

Sheets("POINTDATA").Rows("101:101").Copy Sheets("MAP").Rows(LastRow)

Rob

"Didier Poskin" wrote in message
...
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





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Problem pasting a row from a hidden sheet to the first free row on another visible sheet

How simple and convenient...
Wonderful, really.

Thanks a lot Rob,

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


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
Copy Visible Cells in Sheet with Merged and Hidden Cells rtwiss Excel Discussion (Misc queries) 5 April 25th 23 09:08 AM
Problem Cutting and Pasting from SQL Table to Excel Sheet Chaplain Doug Excel Discussion (Misc queries) 0 April 25th 08 04:55 PM
Hidden sheet problem Freshman Excel Worksheet Functions 0 October 23rd 07 03:17 PM
a problem with pasting into Excell sheet Jurek Setting up and Configuration of Excel 1 March 17th 05 06:54 PM
unprotect sheet in code and make sheet visible peach255 Excel Programming 1 August 1st 03 03:28 AM


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

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"