LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Paste To Visible Cells Macro

Hello:

I was trying to find a way to paste into visible cells only. I found a macro
on another site and have pared it down to the following:

Sub VisbleCellsPasting()
On Error Resume Next

Dim aRng As Range
Dim aRn As Range
Dim bRng As Range

Set aRng = ActiveSheet.Range("B234:B273")

Range("F2").Select

For Each aRn In aRng
Set bRng = ActiveCell
If bRng.EntireRow.Hidden = False Then
bRng = aRn
bRng.Offset(1).Select
Else
Do
If ActiveCell.EntireRow.Hidden = True Then
ActiveCell.Offset(1).Select
End If
Loop Until ActiveCell.EntireRow.Hidden = False
ActiveCell = aRn
ActiveCell.Offset(1).Select
End If

Next

End Sub

This code works fine, but I have some issues...
The macro hard codes the selection that I need to paste and where I need to
paste it. I would like to be able to use the normal Excel copy (Ctrl+C) on my
data I need to paste (where ever it lives whether in a new workbook or not)
and click the macro button and have it paste where I need it. Is this
possible?
 
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
Paste visible cells? Tim Miser Excel Worksheet Functions 8 May 5th 09 11:21 PM
Is it possible paste to visible cells only? NeedToKnow Excel Discussion (Misc queries) 2 August 7th 08 06:04 AM
Paste to Visible Cells only Sandy Burgess Excel Discussion (Misc queries) 1 June 19th 08 11:33 PM
Paste into visible cells ERR229 Excel Discussion (Misc queries) 4 January 19th 06 03:28 AM
Paste into Visible Cells Only CR Excel Discussion (Misc queries) 1 June 10th 05 07:18 PM


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"