Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Assistance (Paste Special)

I am trying to change some code from:

.EntireRow.Copy Sheets("Monthly
Average").Cells(aLastRow, "A")

-TO-

something that will not copy and paste, but will copy and
paste special values into "Monthly Average" sheet.
Everything works fine except when it copys and pastes,
because of formulas in the "Mon" sheet.

I have attached the code so that you can see what I have
written so far.


Dim iLastRow1 As Long
Dim aLastRow As Long
Dim i As Integer
Dim j As Integer
Dim rw As Long, iCol As Integer

'Determine last row in Mon activity sheet with a "clock
hours"

iLastRow1 = Sheets("Mon").Cells(Rows.Count, "V").End
(xlUp).Row
aLastRow = Sheets("Monthly Average").Cells
(Rows.Count, "B").End(xlUp).Row + 1

Application.ScreenUpdating = False

'////////// Mon ////////////
' Copy and paste each row with a "clock hours" into the
archive file

For i = iLastRow1 To 26 Step -1
With Sheets("Mon").Cells(i, "V")
If .Value < "" Then
.EntireRow.Copy Sheets("Monthly
Average").Cells(aLastRow, "A")
End If
End With
aLastRow = aLastRow + 1
Next

' Erase empty rows from daily archive sheet

Sheets("Monthly Average").Select
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete

Application.ScreenUpdating = True


Thanks for the help,
Tom
..


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Code Assistance (Paste Special)

If .Value < "" Then
.EntireRow.Copy _
Sheets("Monthly Average").Cells(aLastRow, "A")
End If

does a copy|paste.

If .Value < "" Then
.EntireRow.Copy
Sheets("Monthly Average").Cells(aLastRow, "A").PasteSpecial _
Paste:=xlPasteValues
End If


Tom Taetsch wrote:

I am trying to change some code from:

.EntireRow.Copy Sheets("Monthly
Average").Cells(aLastRow, "A")

-TO-

something that will not copy and paste, but will copy and
paste special values into "Monthly Average" sheet.
Everything works fine except when it copys and pastes,
because of formulas in the "Mon" sheet.

I have attached the code so that you can see what I have
written so far.

Dim iLastRow1 As Long
Dim aLastRow As Long
Dim i As Integer
Dim j As Integer
Dim rw As Long, iCol As Integer

'Determine last row in Mon activity sheet with a "clock
hours"

iLastRow1 = Sheets("Mon").Cells(Rows.Count, "V").End
(xlUp).Row
aLastRow = Sheets("Monthly Average").Cells
(Rows.Count, "B").End(xlUp).Row + 1

Application.ScreenUpdating = False

'////////// Mon ////////////
' Copy and paste each row with a "clock hours" into the
archive file

For i = iLastRow1 To 26 Step -1
With Sheets("Mon").Cells(i, "V")
If .Value < "" Then
.EntireRow.Copy Sheets("Monthly
Average").Cells(aLastRow, "A")
End If
End With
aLastRow = aLastRow + 1
Next

' Erase empty rows from daily archive sheet

Sheets("Monthly Average").Select
Columns("B:B").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.EntireRow.Delete

Application.ScreenUpdating = True

Thanks for the help,
Tom
.


--

Dave Peterson

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
Paste and Paste Special No Longer Working - Excel 2003 SheriJ Excel Discussion (Misc queries) 2 January 15th 09 09:23 PM
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. stan-the-man Excel Worksheet Functions 7 June 14th 06 08:10 PM
Modify this code to paste special, values Jonsson[_41_] Excel Programming 4 September 5th 04 10:03 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM
Copy Paste Special Value using Code over Several Worksheets John[_81_] Excel Programming 1 April 19th 04 12:09 PM


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