Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Visible Cells in Sheet with Merged and Hidden Cells | Excel Discussion (Misc queries) | |||
Problem Cutting and Pasting from SQL Table to Excel Sheet | Excel Discussion (Misc queries) | |||
Hidden sheet problem | Excel Worksheet Functions | |||
a problem with pasting into Excell sheet | Setting up and Configuration of Excel | |||
unprotect sheet in code and make sheet visible | Excel Programming |