LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Finding the end of Data

In the previous message, you had converted the formulas to values. So
xlcelltypeformulas won't find anything.

If you change the code to drop the .value = .value line or change to look for
constants, then you'll want to explain what doesn't work.

Jim Berglund wrote:

Dave, thanks for your comments. I will incorporate them in the future

I'm still learning. This is the first code I've written in a couple of
years.

BTW, I've tried to modify the following code, but it still doesn't get me to
the bottom of the rows in E with "#N/A" in them. (I'm trying to copy the top
block of cells into another worksheet). What's missing, please?

Dim wb As Workbook
Dim n As Long
Dim i As Integer
Dim myErrorRng As Range

Application.ScreenUpdating = False
i = 1

Set wb = ThisWorkbook
Set wsNumFrum = wb.Worksheets("Numbers From Reverse Directory")
Set wsCallList = wb.Worksheets("Call List")

n = wsNumFrum.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious).Row

'Dave Peterson's suggestions on copying the rows I want
With wsNumFrum
Set myErrorRng = Nothing
On Error Resume Next
Set myErrorRng = .Range("E:E") _
.Cells.SpecialCells(xlCellTypeFormulas, xlErrors)
On Error GoTo 0

If myErrorRng Is Nothing Then
MsgBox "No cells with constant errors in them"
Else
myErrorRng.Offset(0, -4).Copy
With wsCallList
'Copy and paste the data into the Call List
Application.CutCopyMode = False
wsCallList.Activate
Range(Cells(i, 1)).Select
ActiveSheet.Paste
i = i + 1
End With
End If
End With

Jim

"Dave Peterson" wrote in message
...
ps. Just a general note.

You may find that your coding life gets lots easier if you use
mnemonically
significant names.

Instead of:
dim ws4 as worksheet
you could use:
Dim wsRevDirNums as worksheet

Then when you're reviewing/updating your code (especially in 6 months!),
you
won't have to go back to figure out what ws1, ws2, ... are.

ps. And the qualifying the range stuff. I bet the reason you have
ws#.activate
and application.goto in your code is because you were getting errors.
Excel/VBA
knows where those unqualified ranges are (the activesheet). And instead
of
adjusting the code, it was easier to .activate a worksheet.

It's never a bad idea to qualify every range object.


--

Dave Peterson
 
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
Finding specific data and changing cells next to the data fozzetti Excel Programming 1 July 30th 09 09:05 PM
Finding Data Tabatha Excel Worksheet Functions 3 February 25th 09 05:08 PM
Finding max row containing data... Dan Excel Discussion (Misc queries) 5 November 26th 05 09:33 PM
Finding data Paulc Excel Programming 1 March 23rd 05 12:06 PM
FINDING LAST ROW OF THE DATA SUDHENDRA Excel Programming 8 January 9th 04 11:02 PM


All times are GMT +1. The time now is 04:45 PM.

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"