Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Having trouble pasting to first empty cell


your code works for me.


Sub test()
Dim FirstEmpty6 As Range
Dim StartCell6 As Range

With ActiveSheet
Set StartCell6 = .Range("b32")
If IsEmpty(StartCell6.Value) Then
Set FirstEmpty6 = StartCell6
ElseIf IsEmpty(StartCell6.Offset(0, 1).Value) Then
Set FirstEmpty6 = StartCell6.Offset(0, 1)
Else
Set FirstEmpty6 = StartCell6.End(xlToRight).Offset(0, 1)
Sheets("DAILY POLL").Range("c53:c62").Copy
FirstEmpty6.PasteSpecial
Paste:=xlPasteValuesAndNumberFormats, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
End With
End Sub

Gary Keramidas
Excel 2003


"ToddEZ" wrote in message
...

I'm still hacving problems. The cell I'm trying to copy is on a different
sheet. does this matter?

Dim FirstEmpty6 As Range
Dim StartCell6 As Range

With ActiveSheet
Set StartCell6 = .Range("b32")
If IsEmpty(StartCell6.Value) Then
Set FirstEmpty6 = StartCell6
ElseIf IsEmpty(StartCell6.Offset(0, 1).Value) Then
Set FirstEmpty6 = StartCell6.Offset(0, 1)
Else
Set FirstEmpty6 = StartCell6.End(xlToRight).Offset(0, 1)
Sheets("DAILY POLL").Range("c53:c62").Copy
FirstEmpty6.PasteSpecial
Paste:=xlPasteValuesAndNumberFormats, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
End With



"Gary Keramidas" wrote:


it copies whatever is in A1 to the first empty cell in row 32 for me.

Sub test()
Dim FirstEmpty6 As Range
Dim StartCell6 As Range

With ActiveSheet
Set StartCell6 = .Range("b32")
If IsEmpty(StartCell6.Value) Then
Set FirstEmpty6 = StartCell6
ElseIf IsEmpty(StartCell6.Offset(0, 1).Value) Then
Set FirstEmpty6 = StartCell6.Offset(0, 1)
Else
Set FirstEmpty6 = StartCell6.End(xlToRight).Offset(0,
1)
Range("A1").Copy ' change this
FirstEmpty6.PasteSpecial xlPasteValuesAndNumberFormats
End If
End With
End Sub
--

Gary Keramidas
Excel 2003


"Gary Keramidas" <GKeramidasAtMSN.com wrote in message
...
you don't have anything to paste.

i used a1 in this example. watch for wordwrap in the posting.

Sub test()
Dim FirstEmpty6 As Range
Dim StartCell6 As Range

With ActiveSheet
Set StartCell6 = .Range("b32")
If IsEmpty(StartCell6.Value) Then
Set FirstEmpty6 = StartCell6
ElseIf IsEmpty(StartCell6.Offset(0, 1).Value) Then
Set FirstEmpty6 = StartCell6.Offset(0, 1)
Else
Set FirstEmpty6 = StartCell6.End(xlToRight).Offset(0,
1)
Range("A1").Copy
FirstEmpty6.PasteSpecial
Paste:=xlPasteValuesAndNumberFormats, _
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End If
End With
End Sub

--

Gary Keramidas
Excel 2003


"ToddEZ" wrote in message
...
I am trying to paste data to the right most empty cell on row 32,
starting
in
column B. Here is what I got so far:


Dim FirstEmpty6 As Range
Dim StartCell6 As Range

With ActiveSheet
Set StartCell6 = .Range("b32")
If IsEmpty(StartCell6.Value) Then
Set FirstEmpty6 = StartCell6
ElseIf IsEmpty(StartCell6.Offset(0, 1).Value) Then
Set FirstEmpty6 = StartCell6.Offset(0, 1)
Else
Set FirstEmpty6 = StartCell6.End(xlToRight).Offset(0, 1)

FirstEmpty6.Select
Selection.PasteSpecial
Paste:=xlPasteValuesAndNumberFormats,
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

End If
End With




Reply
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
Trouble Pasting RNorfolk Excel Discussion (Misc queries) 10 June 25th 09 09:29 PM
Pasting data top 1st empty cell in range wfcmark Excel Discussion (Misc queries) 4 December 8th 05 10:46 AM
Pasting on next empty cell Byron[_2_] Excel Programming 1 April 16th 04 02:28 AM
Selecting and pasting to an empty cell Craig from MI Excel Programming 1 March 7th 04 06:36 AM


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