LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
tig tig is offline
external usenet poster
 
Posts: 10
Default Find first blank cell in single column named range

I've found some posts that cover something similar to what I'm trying
to do, but I've not been able to apply it to my situation. It maybe
just syntax.

I have a named range that covers A7-A16. I need to find the first
blank cell in that range. I tried to use:

Set rng = Range("AACash")
rng.Find("").Select

but I get a runtime 91 error: "Object variable or With block variable
not set".

Maybe I'm just missing something. Any ideas or alternatives to apply?

TIA

Here's my code so far:

Sub Asset_Allocation()

Dim lastrow&
Dim assettype$
Dim currentrow&
Dim acct_type1$
Dim acct_type2$
Dim assetname$
Dim amt#

Dim rng As Range
Dim aa_row1&
Dim aa_lastrow&

Sheets("Asset Detail").Select
'start in S10
'find last row of print area
lastrow = Range("Print_Area").Rows.Count

With ActiveSheet
Range("S10").Select
For x = 10 To lastrow
currentrow = ActiveCell.Row
assettype = ActiveCell.Value
If assettype = "" Then GoTo next_rec
acct_type1 = Range("AB" & currentrow).Value
acct_type2 = Range("AD" & currentrow).Value
assetname = Range("H" & currentrow).Value
amt = Range("J" & currentrow).Value

Sheets("Asset Allocation").Select
With ActiveSheet
Select Case assettype
Case "Cash"
Set rng = Range("AACash")
------ rng.Find("").Select


Case "Fixed Income"
Case "Large Cap"
Case "Mid Cap"
Case "Small Cap"
Case "Foreign"
Case "Company Stock"
Case "Real Estate"
Case "Alternative Investment"
Case Else
GoTo next_rec
End Select
End With
next_rec:
Next x
End With

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
Average Formula to display blank cell if named range is blank Rachael F Excel Worksheet Functions 3 February 22nd 08 05:05 PM
Query Named Range Return Single Column Value JeffP-> Excel Worksheet Functions 5 November 29th 07 10:30 PM
Named Range reference via single Cell Graham Excel Discussion (Misc queries) 0 July 26th 06 09:37 AM
named Range Referenced vai single cell Graham Excel Discussion (Misc queries) 1 July 26th 06 09:31 AM
Identifying single column within named range ESAEO Excel Discussion (Misc queries) 2 March 24th 05 09:30 PM


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