LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Creating a new worksheet by checking for blank values in a ran

Excellent, all is working now! I did have to make a change to the
column and row indicators (r.Row - 3 and r.Column - 2) to get it to
work correctly. I have no idea why this is the case, I just messed
around with it until it worked. In any case, THANKS MARTIN!!! The new
code is below.........

Sub Reconcile()
Dim sh As Worksheet
Dim r As Range, rng As Range
Dim i As Integer

i = 1
Set rng = Selection
' get the selected range
Set sh = ActiveWorkbook.Sheets.Add
' add a new sheet
For Each r In rng
'iterate through all cells of rng
If r.Value = "" Then
'check if cell is empty
sh.Cells(i, 1).Value = rng(r.Row - 3, 0).Value
' write the cell value at left of range in col1
sh.Cells(i, 2).Value = rng(0, r.Column - 2).Value
' write the cell value at top of range to col2
i = i + 1
'goto next row
End If
Next r


End Sub



 
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
Checking for all blank cells in a range orcolumn. Mikey Excel Programming 1 June 30th 05 03:59 PM
Checking to See if Range Values Add up to 100 Paige Excel Programming 4 March 25th 05 12:01 AM
Checking ALL values in a range nospaminlich Excel Discussion (Misc queries) 13 February 10th 05 09:29 AM
checking if worksheet is blank Tommi[_2_] Excel Programming 1 November 2nd 03 03:59 PM
Checking if worksheet is blank Tommi[_2_] Excel Programming 3 October 31st 03 02:22 PM


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