Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Identify row based on criteria and copy paste special values only

I've got the following code that does select the correct row and bolds
it, but it's not doing the copy and paste special.....can anyone help
me out on this?

For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 7) = "" Then
Rows(i).Select
Selection.Font.Bold = True
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

End If
Next i
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Identify row based on criteria and copy paste special values only

Hi

As far as I can tell, it is doing what it is supposed to do.

Bold the selected line and substitute formulas in same line with
constant values.

But the code will run a bit faster if you skip the select statements:

For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 7) = "" Then
With Rows(i)
.Font.Bold = True
.Copy
.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End If
Next i
Application.CutCopyMode = False

Hopes this helps.
....
Per


On 20 Jul., 21:41, S Himmelrich wrote:
I've got the following code that does select the correct row and bolds
it, but it's not doing the copy and paste special.....can anyone help
me out on this?

* * For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
* * * * If Cells(i, 7) = "" Then
* * * * * * Rows(i).Select
* * * * * * Selection.Font.Bold = True
* * * * * * Selection.Copy
* * * * * * Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
* * * * * * :=False, Transpose:=False

* * * * End If
* * Next i


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Identify row based on criteria and copy paste special values only

Hi there,

Copy and paste the following:

Sub HighlightAndCopy()
Dim sht As Worksheet, i As Long
Set sht = ThisWorkbook.Worksheets("Sheet1")

With sht
For i = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
If .Cells(i, 7) = "" Then
With .Rows(i)
.Font.Bold = True
.Copy
.PasteSpecial Paste:=xlPasteValues
End With
End If
Next i
Application.CutCopyMode = False
End With
End Sub
--
A. Ch. Eirinberg


"S Himmelrich" wrote:

I've got the following code that does select the correct row and bolds
it, but it's not doing the copy and paste special.....can anyone help
me out on this?

For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 7) = "" Then
Rows(i).Select
Selection.Font.Bold = True
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

End If
Next i

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Identify row based on criteria and copy paste special values only

On Jul 20, 4:07*pm, Howard31
wrote:
Hi there,

Copy and paste the following:

Sub HighlightAndCopy()
* * Dim sht As Worksheet, i As Long
* * Set sht = ThisWorkbook.Worksheets("Sheet1")

* * With sht
* * * * For i = 1 To .Cells(.Rows.Count, 1).End(xlUp).Row
* * * * * * If .Cells(i, 7) = "" Then
* * * * * * * * With .Rows(i)
* * * * * * * * * * .Font.Bold = True
* * * * * * * * * * .Copy
* * * * * * * * * * .PasteSpecial Paste:=xlPasteValues
* * * * * * * * End With
* * * * * * End If
* * * * Next i
* * * * Application.CutCopyMode = False
* * End With
End Sub
--
A. Ch. Eirinberg



"SHimmelrich" wrote:
I've got the following code that does select the correct row and bolds
it, but it's not doing the copy and paste special.....can anyone help
me out on this?


* * For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
* * * * If Cells(i, 7) = "" Then
* * * * * * Rows(i).Select
* * * * * * Selection.Font.Bold = True
* * * * * * Selection.Copy
* * * * * * Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
* * * * * * :=False, Transpose:=False


* * * * End If
* * Next i- Hide quoted text -


- Show quoted text -


Thank you!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Identify row based on criteria and copy paste special values only

On Jul 20, 3:59*pm, Per Jessen wrote:
Hi

As far as I can tell, it is doing what it is supposed to do.

Bold the selected line and substitute formulas in same line with
constant values.

But the code will run a bit faster if you skip the select statements:

For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
* * If Cells(i, 7) = "" Then
* * * * With Rows(i)
* * * * * * .Font.Bold = True
* * * * * * .Copy
* * * * * * .PasteSpecial Paste:=xlPasteValues, _
* * * * * * * * Operation:=xlNone, SkipBlanks _
* * * * * * * * :=False, Transpose:=False
* * * * End With
* * End If
Next i
Application.CutCopyMode = False

Hopes this helps.
...
Per

On 20 Jul., 21:41, wrote:



I've got the following code that does select the correct row and bolds
it, but it's not doing the copy and paste special.....can anyone help
me out on this?


* * For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
* * * * If Cells(i, 7) = "" Then
* * * * * * Rows(i).Select
* * * * * * Selection.Font.Bold = True
* * * * * * Selection.Copy
* * * * * * Selection.PasteSpecial Paste:=xlPasteValues,
Operation:=xlNone, SkipBlanks _
* * * * * * :=False, Transpose:=False


* * * * End If
* * Next i- Hide quoted text -


- Show quoted text -


Thank you!
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
Copy - Paste Special (Values) ankur Excel Programming 2 December 19th 06 01:16 PM
Copy & Paste Special Using Values Paul Black Excel Programming 5 November 29th 06 04:35 AM
copy paste special values mike allen[_2_] Excel Programming 7 October 12th 05 06:06 PM
Dynamic Copy/Paste Special Formulas/Paste Special Values Sharon Perez Excel Programming 3 August 7th 04 09:49 PM
Complex identify values then cut/copy/paste query ian123[_47_] Excel Programming 2 January 25th 04 01:35 PM


All times are GMT +1. The time now is 06:05 PM.

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"