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: 24
Default Problem with selection blank or non blank

Hi All

I need help in resolving my error code. I would like to find the blank cells
in my range and then insert formula. Macro works correctly only first time.
If I run macro next time, it advice me next error:
Run-time error '1004': no cells were found.
My code you can see below


Dim Lrow As Long
With ActiveSheet
Lrow = Range("b8:B" & Rows.Count).End(xlDown).Row

Set myrange = Range("N8:N" & Lrow)
myrange.Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.FormulaR1C1 = "=IF(RC[-1]0,TODAY(),"""")"

myrange.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.NumberFormat = "d-mmm"
End With


If """" means "blank", then what is wrong in my code

Best Regards


 
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
Start Cell B1 then find first blank cell, insert subtotal, next non blank, then next blank, sutotal cells in between......... [email protected][_2_] Excel Programming 2 June 7th 07 09:27 PM
Pasting Selection In First Blank Row tnederlof Excel Discussion (Misc queries) 5 February 6th 07 10:38 PM
Delete blank rows in selection Jim Thomlinson[_5_] Excel Programming 0 February 13th 06 08:40 PM
Inserting Blank Lines in Selection Garry Douglas Excel Programming 7 July 26th 04 11:48 PM
Deleting blank cells in a selection Novice[_10_] Excel Programming 6 December 24th 03 12:41 AM


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