Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default End(xldown) not always going to last cell?

Hi all, Im using Range("f1").End(xlDown).Offset(1, 0).Select to get to
the next empty cell downwards in a column, It doesnt always work?
sometimes it selects the same cell over and over (im using this in
various instances).

is it something to do with the cell containing a number? also if the
collumn is blank then it crashes out, i have to have a line of 1s above
the column to make the code work.

is there a better way?


Duncan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default End(xldown) not always going to last cell?

Hi Duncan,

you can use:

range("F" & application.rows.count).end(xlup).offset(1,0).sele ct

If I understood your question correctly.

Regards,
Ivan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default End(xldown) not always going to last cell?

Hi Duncan

is there a better way?


Try:

Dim rng as Range

Set rng = Cells(Rows.Count, "A").End(xlUp)(2)

Additionally, it is rarely necessary to make selections: it is usually more
efficient to manipulate the range object.


---
Regards,
Norman


"Duncan" wrote in message
oups.com...
Hi all, Im using Range("f1").End(xlDown).Offset(1, 0).Select to get to
the next empty cell downwards in a column, It doesnt always work?
sometimes it selects the same cell over and over (im using this in
various instances).

is it something to do with the cell containing a number? also if the
collumn is blank then it crashes out, i have to have a line of 1s above
the column to make the code work.

is there a better way?


Duncan



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default End(xldown) not always going to last cell?

Brill, thats a lot better than before, also, I have changed it do
rng2.Value instead of selecting it and then doing activecell.value. I
think that will be faster.

Just another question.....im using rng2.Value = Now() but I could
really do with just the time and not the date, is that a command?

Duncan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default End(xldown) not always going to last cell?

Hi Duncan

Just another question.....im using rng2.Value = Now() but I could
really do with just the time and not the date, is that a command?



Try:

rng2.Value = Time()

---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default End(xldown) not always going to last cell?

Many thanks, it appears I am as thick as I thought I was....i have used
time() before.........

Many thanks all

Duncan

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default End(xldown) not always going to last cell?

To set the time:

Sub asdf()
Selection.NumberFormat = "[$-409]h:mm:ss AM/PM;@"
Selection.Value = Now() - Int(Now())
End Sub
--
Gary's Student


"Duncan" wrote:

Brill, thats a lot better than before, also, I have changed it do
rng2.Value instead of selecting it and then doing activecell.value. I
think that will be faster.

Just another question.....im using rng2.Value = Now() but I could
really do with just the time and not the date, is that a command?

Duncan


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
End(xlDown) not working? RAHokie Excel Discussion (Misc queries) 2 January 19th 07 12:40 AM
Unable to get last filled cell address from Range.End(xlDown) method vedpatel[_2_] Excel Programming 1 February 28th 06 09:09 AM
repeated end(xldown) R.VENKATARAMAN Excel Programming 6 December 28th 05 06:43 PM
XlDown: Go to next blank row tomwashere2 Excel Programming 2 August 16th 05 11:15 PM
xldown and xlright He4Giv Excel Programming 2 January 29th 04 12:41 AM


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