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: 343
Default Paste and display issue

My code below does exactly what I need it to do. My only issue is that if
it is pasting the data way down on the sheet, the user has to scroll down to
find if. Any way to have the newly pasted data display after it is pasted?



Sub Paste_Data()

Dim BCell, NBCell
Dim PasteTo As Range
Dim rng

On Error GoTo Done

Range("B5").Select

Application.ScreenUpdating = False
Application.EnableEvents = False

For i = 1 To 65536
If ActiveCell.Value = Empty Then
BCell = "B" & CStr(i - 1)
NBCell = "B" & CStr(i - 2)

GoTo Finished

Else
Range("B" & CStr(i + 1)).Select
End If
Next i


Finished:

Application.EnableEvents = True

Set rng = Cells(ActiveCell.Row, 1)
rng(1, 2).Select

Selection.PasteSpecial Paste:=xlPasteValues

Application.EnableEvents = True

Done:

End Sub

 
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
Display Issue Going Crazy for Graphics Excel Discussion (Misc queries) 3 January 28th 09 05:44 PM
Control button display issue Mike[_123_] Excel Programming 3 July 28th 08 03:36 PM
Display issue bluenoser1946 Excel Worksheet Functions 5 August 7th 05 06:15 PM
ActiveX Controls Display Issue? [email protected] Excel Discussion (Misc queries) 0 March 5th 05 05:43 PM
Calendar Control - Display Issue AG[_5_] Excel Programming 0 November 10th 04 08:42 PM


All times are GMT +1. The time now is 03:21 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"