ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   COPY - *want* to include hidden columns (https://www.excelbanter.com/excel-programming/335458-copy-%2Awant%2A-include-hidden-columns.html)

Eric[_27_]

COPY - *want* to include hidden columns
 
I need to copy a row from one worksheet to another, and am using this
statement to do so: Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

where sCurrentTaskAddress represents the address of an entire row in the
source wks. I could swear it was working as I'd expect it to, copying ALL
the cells in the row whether some columns were hidden or not, but it's only
copying visible cells.

I thought you need to do Special(xlVisible) or something like that to get
that behavior.

Any help to let me copy everything, hidden or not, much appreciated as I
need to get this done.

Thanks, Eric



Nigel

COPY - *want* to include hidden columns
 
Copy will copy hidden columns/rows BUT the columns/rows to which the data is
copied will also be hidden on the destination sheet.



--
Cheers
Nigel



"Eric" wrote in message
nk.net...
I need to copy a row from one worksheet to another, and am using this
statement to do so: Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

where sCurrentTaskAddress represents the address of an entire row in the
source wks. I could swear it was working as I'd expect it to, copying ALL
the cells in the row whether some columns were hidden or not, but it's

only
copying visible cells.

I thought you need to do Special(xlVisible) or something like that to get
that behavior.

Any help to let me copy everything, hidden or not, much appreciated as I
need to get this done.

Thanks, Eric





Eric[_27_]

COPY - *want* to include hidden columns
 
Yes, I see that. Is there an easy way to unhide all cells in code (and not
affect the worksheet) before the paste?

Thanks, Eric

"Nigel" wrote in message
...
Copy will copy hidden columns/rows BUT the columns/rows to which the data
is
copied will also be hidden on the destination sheet.



--
Cheers
Nigel



"Eric" wrote in message
nk.net...
I need to copy a row from one worksheet to another, and am using this
statement to do so: Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

where sCurrentTaskAddress represents the address of an entire row in the
source wks. I could swear it was working as I'd expect it to, copying ALL
the cells in the row whether some columns were hidden or not, but it's

only
copying visible cells.

I thought you need to do Special(xlVisible) or something like that to get
that behavior.

Any help to let me copy everything, hidden or not, much appreciated as I
need to get this done.

Thanks, Eric







Tom Ogilvy

COPY - *want* to include hidden columns
 
With worksheets("Destination")
.Rows.Hidden = False
.Columns.Hidden = False
End With

--
Regards,
Tom Ogilvy


"Eric" wrote in message
nk.net...
Yes, I see that. Is there an easy way to unhide all cells in code (and not
affect the worksheet) before the paste?

Thanks, Eric

"Nigel" wrote in message
...
Copy will copy hidden columns/rows BUT the columns/rows to which the

data
is
copied will also be hidden on the destination sheet.



--
Cheers
Nigel



"Eric" wrote in message
nk.net...
I need to copy a row from one worksheet to another, and am using this
statement to do so: Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

where sCurrentTaskAddress represents the address of an entire row in

the
source wks. I could swear it was working as I'd expect it to, copying

ALL
the cells in the row whether some columns were hidden or not, but it's

only
copying visible cells.

I thought you need to do Special(xlVisible) or something like that to

get
that behavior.

Any help to let me copy everything, hidden or not, much appreciated as

I
need to get this done.

Thanks, Eric









Eric[_27_]

COPY - *want* to include hidden columns
 
Thanks Tom, I'm sure this works but it isn't for me for some reason, even
when I paste it into a new wkb where I wouldn't have to worry about any
other date. A code snippet is below if that helps...maybe I'm just not
putting into the right spot:


' insert a new row into history
Dim sNextUpdateRowAddress As String
sNextUpdateRowAddress =
InsertNewRow(gclsEventHandler.TaskHistoryWks.Range (gsRNG_INSERT_ROW))

' copy the current task to the new row.
Dim sCurrentTaskAddress As String
sCurrentTaskAddress = gclsEventHandler.CurrentTaskAddress
Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

Isn't there some way to just make all the cells in my source row visible via
code after they are copied?

Much thanks, Eric
"Tom Ogilvy" wrote in message
...
With worksheets("Destination")
.Rows.Hidden = False
.Columns.Hidden = False
End With

--
Regards,
Tom Ogilvy


"Eric" wrote in message
nk.net...
Yes, I see that. Is there an easy way to unhide all cells in code (and
not
affect the worksheet) before the paste?

Thanks, Eric

"Nigel" wrote in message
...
Copy will copy hidden columns/rows BUT the columns/rows to which the

data
is
copied will also be hidden on the destination sheet.



--
Cheers
Nigel



"Eric" wrote in message
nk.net...
I need to copy a row from one worksheet to another, and am using this
statement to do so: Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

where sCurrentTaskAddress represents the address of an entire row in

the
source wks. I could swear it was working as I'd expect it to, copying

ALL
the cells in the row whether some columns were hidden or not, but it's
only
copying visible cells.

I thought you need to do Special(xlVisible) or something like that to

get
that behavior.

Any help to let me copy everything, hidden or not, much appreciated as

I
need to get this done.

Thanks, Eric











Tom Ogilvy

COPY - *want* to include hidden columns
 
sure. Unhide the hidden columns in the worksheet where you want them
unhidden. Hidden is a property of an entirerow (for row height) and for an
entirecolumn (for column width). You can't hide and unhide an individual
cell.

--
Regards,
Tom Ogilvy


"Eric" wrote in message
ink.net...
Thanks Tom, I'm sure this works but it isn't for me for some reason, even
when I paste it into a new wkb where I wouldn't have to worry about any
other date. A code snippet is below if that helps...maybe I'm just not
putting into the right spot:


' insert a new row into history
Dim sNextUpdateRowAddress As String
sNextUpdateRowAddress =
InsertNewRow(gclsEventHandler.TaskHistoryWks.Range (gsRNG_INSERT_ROW))

' copy the current task to the new row.
Dim sCurrentTaskAddress As String
sCurrentTaskAddress = gclsEventHandler.CurrentTaskAddress
Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

Isn't there some way to just make all the cells in my source row visible

via
code after they are copied?

Much thanks, Eric
"Tom Ogilvy" wrote in message
...
With worksheets("Destination")
.Rows.Hidden = False
.Columns.Hidden = False
End With

--
Regards,
Tom Ogilvy


"Eric" wrote in message
nk.net...
Yes, I see that. Is there an easy way to unhide all cells in code (and
not
affect the worksheet) before the paste?

Thanks, Eric

"Nigel" wrote in message
...
Copy will copy hidden columns/rows BUT the columns/rows to which the

data
is
copied will also be hidden on the destination sheet.



--
Cheers
Nigel



"Eric" wrote in message
nk.net...
I need to copy a row from one worksheet to another, and am using

this
statement to do so: Application.Range(sCurrentTaskAddress).Copy
Destination:=Application.Range(sNextUpdateRowAddre ss)

where sCurrentTaskAddress represents the address of an entire row in

the
source wks. I could swear it was working as I'd expect it to,

copying
ALL
the cells in the row whether some columns were hidden or not, but

it's
only
copying visible cells.

I thought you need to do Special(xlVisible) or something like that

to
get
that behavior.

Any help to let me copy everything, hidden or not, much appreciated

as
I
need to get this done.

Thanks, Eric














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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com