Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default impossible to change the activecell???

I have a function which analyzes the active cell, offsets it by one, and
loops this way until it find an empty cell. Its my version of finding the
end of a contiguous range. It work well in almost every condition, but it
appears that when it is called from a particular function, the activecell
cannot be offset.

The calling code does nothing more then call the function, just like any
other function

Does anyone know of a condition where the activecell is locked?


THIS IS THE CALLING FUNCTION
Private Sub ListOfRepsBox_Click()

UpdateStores

If Me.MultiPage1.Value = 1 Then Me.StoreEntry.SetFocus

End Sub


THIS IS THE LOOP
ElseIf Selection = "col" Then

Do While Not IsEmpty(ActiveCell)

ActiveCell.Offset(NextCell, 0).Select
Count = Count + 1

Loop

If Count 1 Then ActiveCell.Offset(-1, 0).Select

End If


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default impossible to change the activecell???

Finding the end of a continuous renage is a hell of a lot
easier and faster by using:

Selection.End(xlToRight).Select
or xlTo Left, xlUp, xlDown...

Give it a shot.

Nikos Y. (nyannaco at in dot gr)
-----Original Message-----
I have a function which analyzes the active cell,

offsets it by one, and
loops this way until it find an empty cell. Its my

version of finding the
end of a contiguous range. It work well in almost every

condition, but it
appears that when it is called from a particular

function, the activecell
cannot be offset.

The calling code does nothing more then call the

function, just like any
other function

Does anyone know of a condition where the activecell is

locked?


THIS IS THE CALLING FUNCTION
Private Sub ListOfRepsBox_Click()

UpdateStores

If Me.MultiPage1.Value = 1 Then Me.StoreEntry.SetFocus

End Sub


THIS IS THE LOOP
ElseIf Selection = "col" Then

Do While Not IsEmpty(ActiveCell)

ActiveCell.Offset(NextCell, 0).Select
Count = Count + 1

Loop

If Count 1 Then ActiveCell.Offset(-1,

0).Select

End If


.

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
next to impossible IF function incompetent[_2_] Excel Worksheet Functions 23 February 27th 08 06:40 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
Am I trying the impossible? Max_power Excel Discussion (Misc queries) 5 March 23rd 06 09:27 PM
chart MAcro to change on activecell flow23 Excel Discussion (Misc queries) 0 December 7th 05 04:46 PM
code to change activecell neopolitan Excel Programming 2 October 2nd 03 09:05 PM


All times are GMT +1. The time now is 03:00 PM.

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"