Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
devide rng of copy
i have this rng: lngMaxRow = Range("A65536").End(xlUp).Row Set rng = Union(Range("A3:K" & lngMaxRow), Range("N3:AC" lngMaxRow)).SpecialCells(xlCellTypeVisible) i would want to copy the first block a3:k of current sheet into a3:k o ActiveWorkbook.Sheets(1) i would want to copy the second block n3:ac of current sheet into n3:a of ActiveWorkbook.Sheets(1) i have used this but not work!!!!!!!!: rng.Copy ActiveWorkbook.Sheets(1).Range("A3") _________________ -- sal2 ----------------------------------------------------------------------- sal21's Profile: http://www.excelforum.com/member.php...nfo&userid=204 View this thread: http://www.excelforum.com/showthread.php?threadid=49163 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
devide rng of copy
Try:
'---------------------------------------------------------------- lngMaxRow = Range("A65536").End(xlUp).Row On Error Resume Next Set rng = Range("A3:K" & lngMaxRow).SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then rng.Copy _ ActiveWorkbook.Sheets(1).Range("A3") Set rng = Nothing On Error Resume Next Set rng = Range("N3:AC" & lngMaxRow).SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not rng Is Nothing Then rng.Copy _ ActiveWorkbook.Sheets(1).Range("N3") '------------------------------------------------------------------ Hope this helps Rowan sal21 wrote: i have this rng: lngMaxRow = Range("A65536").End(xlUp).Row Set rng = Union(Range("A3:K" & lngMaxRow), Range("N3:AC" & lngMaxRow)).SpecialCells(xlCellTypeVisible) i would want to copy the first block a3:k of current sheet into a3:k of ActiveWorkbook.Sheets(1) i would want to copy the second block n3:ac of current sheet into n3:ac of ActiveWorkbook.Sheets(1) i have used this but not work!!!!!!!!: rng.Copy ActiveWorkbook.Sheets(1).Range("A3") __________________ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sum and devide with not null value | Excel Discussion (Misc queries) | |||
devide by 1000 | Excel Discussion (Misc queries) | |||
devide by 0 error | Excel Worksheet Functions | |||
Devide/0 error | Excel Programming | |||
devide the whole column... | Excel Programming |