Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select last blank cell in a range of data


Hi,

During the running of my macro, I want the macro to be able to select
the first blank cell it comes to, at the bottom of a list of data.

So, if cells A1:A12 contained data, then I'd want cell A13 to be
selected by the macro.

Any ideas? Must be an easy one for some of you!


--
DJ Dusty
------------------------------------------------------------------------
DJ Dusty's Profile: http://www.excelforum.com/member.php...o&userid=16335
View this thread: http://www.excelforum.com/showthread...hreadid=520077

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Select last blank cell in a range of data

Try something like

Dim Rng As Range
Set Rng = Cells(Rows.Count, "A").End(xlUp)(2,1)



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"DJ Dusty"
wrote in
message
...

Hi,

During the running of my macro, I want the macro to be able to
select
the first blank cell it comes to, at the bottom of a list of
data.

So, if cells A1:A12 contained data, then I'd want cell A13 to
be
selected by the macro.

Any ideas? Must be an easy one for some of you!


--
DJ Dusty
------------------------------------------------------------------------
DJ Dusty's Profile:
http://www.excelforum.com/member.php...o&userid=16335
View this thread:
http://www.excelforum.com/showthread...hreadid=520077



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select last blank cell in a range of data


Thanks, but hasn't worked - Do I use the Rng variable as a range
selection?


--
DJ Dusty
------------------------------------------------------------------------
DJ Dusty's Profile: http://www.excelforum.com/member.php...o&userid=16335
View this thread: http://www.excelforum.com/showthread...hreadid=520077

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Select last blank cell in a range of data

To select the desired cell, try this:

Sub SelectFirstBlank()
Cells(Rows.Count, "A").End(xlUp).Offset(1,0).Select
end sub

HTH
--
AP

"DJ Dusty" a écrit
dans le message de
...

Thanks, but hasn't worked - Do I use the Rng variable as a range
selection?


--
DJ Dusty
------------------------------------------------------------------------
DJ Dusty's Profile:

http://www.excelforum.com/member.php...o&userid=16335
View this thread: http://www.excelforum.com/showthread...hreadid=520077



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select last blank cell in a range of data


This was exactly the code ive been looking for and ive used it to define
where to paste some copied data into,

I would now like to manipulate it further so that I could copy the
formula from row 2 all the way down to the last row, ive been trying
something along the lines of

Range("F2").Select
Selection.Copy

Dim rng2 As Range
Set rng2 = Cells(Rows.Count, "A").End(xlUp)(1, 6)
rng2.Select

Range("F2:rng2").Select
ActiveSheet.Paste

It is not quite working,
1st question - can i use the bit in red?
2nd question - will this make all cells between F2 and rng2 active so
values can be pasted into them?


--
cereldine
------------------------------------------------------------------------
cereldine's Profile: http://www.excelforum.com/member.php...o&userid=32069
View this thread: http://www.excelforum.com/showthread...hreadid=520077

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
Check data range and return false value if a cell is blank DavidS Excel Discussion (Misc queries) 2 June 1st 10 09:12 PM
Select range of cells from A1 to last cell with data? Bob Arnett Excel Discussion (Misc queries) 8 September 25th 09 04:31 PM
Extracting/deleting select data from range of cell DipyDawg Excel Discussion (Misc queries) 4 May 6th 08 06:48 PM
Average Formula to display blank cell if named range is blank Rachael F Excel Worksheet Functions 3 February 22nd 08 05:05 PM
Macro to select range based on cell not being blank neb[_5_] Excel Programming 0 July 20th 05 06:04 PM


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