Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need Help With Moving Active Cell


Ok, I have done the following coding and it works very well.

Sub PltfrmWs()
Range("B25").Activate
If Range("B25") = 0 Then
Range("A24:G29").Delete
Else
Range("A26:G26").Resize(Range("B25").Value).Inser
shift:=xlDown

End If
End Sub


My next question to you guys, is how can I get this to drop the activ
cell down past whatever number is in "B25". Lets say "B25" is qty 5.
I need this to move down from "B25"(Currently the active cell) to th
next line after the 5 blank inserts(or whatever qty is in "B25"). I
this possible, if so can you lead me to the answer?

Thank You,
Chri

--
zero63
-----------------------------------------------------------------------
zero635's Profile: http://www.excelforum.com/member.php...fo&userid=2480
View this thread: http://www.excelforum.com/showthread.php?threadid=38819

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Need Help With Moving Active Cell

Hi Zero635,

Try:

With Range("B25")
.Offset(.Value).Select
End With


However...

Why are you selecting? It is rarely necessary, or desirable, to make
physical selections. So, unless your UI dictates otherwise, try to avoid
selrctions.

End of sermon!

---
Regards,
Norman



"zero635" wrote in
message ...

Ok, I have done the following coding and it works very well.

Sub PltfrmWs()
Range("B25").Activate
If Range("B25") = 0 Then
Range("A24:G29").Delete
Else
Range("A26:G26").Resize(Range("B25").Value).Insert
shift:=xlDown

End If
End Sub


My next question to you guys, is how can I get this to drop the active
cell down past whatever number is in "B25". Lets say "B25" is qty 5.
I need this to move down from "B25"(Currently the active cell) to the
next line after the 5 blank inserts(or whatever qty is in "B25"). Is
this possible, if so can you lead me to the answer?

Thank You,
Chris


--
zero635
------------------------------------------------------------------------
zero635's Profile:
http://www.excelforum.com/member.php...o&userid=24802
View this thread: http://www.excelforum.com/showthread...hreadid=388194



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need Help With Moving Active Cell


Thank You for your reponse. I am fairly new to this programming. I
wouldn't make these manual selections if I knew of a beter way to
continue on with what I am doing.

Basically with the code I pasted earlier, I don't know how to make the
code continue down the spreadsheet basically doing the same thing to
other lines.

This is a packing slip with several different sections. The first has
2 parts that are serialized and I need the amount of spaces that the
qty is calling for. (For example: B25 = 2 then I need 2 spaces below
A25:G25. Then once this shifts I would need 2 spaces below A28:G28,
But since the qty constantly changes, I am not sure how to write this
code to insert rows based on cell value and then run down the packing
slip and doing this to all the serialized parts.

Sorry if this sounds confusing. I know what I need to do, just getting
there is the problem. I have learned alot from this forum and I have
actually made alittle progress with other macros I have written that
has actually tripled my work.

Thank You again for your reply.

Chris :)


--
zero635
------------------------------------------------------------------------
zero635's Profile: http://www.excelforum.com/member.php...o&userid=24802
View this thread: http://www.excelforum.com/showthread...hreadid=388194

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
Excel 2002: Can I have a moving colored band for active row ? Mr. Low Excel Discussion (Misc queries) 1 August 5th 09 03:05 PM
HOW TO COLOR ACTIVE LINE CURSOR IS ON WHEN MOVING STAN Excel Discussion (Misc queries) 1 May 26th 06 03:41 PM
Moving the Active cell to the left of the screen Dave Bash Excel Programming 1 December 17th 03 04:11 PM
Moving active cell after copy T Pitts Excel Programming 6 October 17th 03 08:16 PM
Moving active cell Scott Excel Programming 1 July 31st 03 05:52 PM


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