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: 10
Default Pasting problems

I have this code thus far. I want all of this information to be on the
same line but as of right now it buts it on two seperate lines. How
can I combine the codes and have them com in on the same line.

Sub copy_1_Values_PasteSpecial()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Application.ScreenUpdating = False
Lr = LastRow(Sheets("Invoices")) + 1
Set sourceRange = Sheets("PO Form").Range("A44:G44")
Set destrange = Sheets("Invoices").Range("A" & Lr)
sourceRange.Copy
destrange.PasteSpecial xlPasteValues, , False, False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

Sub copy_3_Values_PasteSpecial()
Dim sourceRange As Range
Dim destrange As Range
Dim Lr As Long
Application.ScreenUpdating = False
Lr = LastRow(Sheets("Invoices")) + 1
Set sourceRange = Sheets("PO Form").Range("H44:H44")
Set destrange = Sheets("Invoices").Range("H" & Lr)
sourceRange.Copy
destrange.PasteSpecial xlPasteFormulas, , False, False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

 
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
Problems with copying and pasting dates from one worksheet to anot hroberto Excel Discussion (Misc queries) 1 March 6th 07 02:49 AM
Pasting problems mikeymike02135 Excel Discussion (Misc queries) 0 April 6th 06 08:53 PM
Pasting on Filtered Data Sheets without pasting onto hidden cells CCSMCA Excel Discussion (Misc queries) 1 August 28th 05 01:22 PM
Excel - Word: Problems copying/pasting shapes Nick Hebb Excel Programming 1 June 17th 05 09:55 PM
Problems pasting images into Excel Wazooli Excel Discussion (Misc queries) 2 December 7th 04 11:33 PM


All times are GMT +1. The time now is 12:34 AM.

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"