Just learning the tricks of the trade!

JJRudd

New Member
Joined
Dec 6, 2005
Messages
34
Okay, I've, searched the entire board, read through a ton of questions, but I'm am too new at Excel to completely understand some of the answers and then adapt them to my situation. :confused: :rolleyes:
This is a sample of what I have.
A B C D E F G ........Q
Name|position|Supv Name|Supv Began| hired |Last report|Proj next|
Bob | desk | Sammy | 2Feb03 |2 Feb 03| 5Feb05 |5Feb06 |

I have a formula that updates G whenever I update a date in F. It automatically bumps out G by a year. I'm wanting the program to automatically sort using column G, having the closest Projected date being on top. How can I make this happen? Each row needs to stay together. ie: A5-Q5 stays together. A6-Q6, etc. Any help would be appreciated.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Actually, I have on problem. After I make my changes and it sorts itself, when I try to save, it pops up saying I ned to debug the code. It highlights the RNG1.Select in yellow and won't let me save. Now, if I just push the END button on the error screen, all is well, but what do I need to do so it won't pop up at all?


Does any of what i typed make sense???
 
Upvote 0
just_Jon,
It was on posting page 1 for this listing. Here it is:

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim RNG1 As Range


Set RNG1 = Range("A1:IV65536")
RNG1.Select
Selection.Sort Key1:=Range("H1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal


End Sub
 
Upvote 0
JJRudd,
You may want to go ahead and post your changed code. When I use the code I gave you, it still allows me to save without any problem. Also, it will give Just_Jon a better frame of reference than mine did (hopefully) - He is much more advanced than I and might be able to tell you exactly what is wrong.

Good luck,
Colbymack
 
Upvote 0
Private Sub Worksheet_Change(ByVal Target As Range)
Dim RNG1 As Range

Set RNG1 = Range("A4:Z100")
RNG1.Select
Selection.Sort Key1:=Range("G4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

End Sub

Here is my code. When I try to save, it throws up the debug screen and the RNG1.Select is highlighted in yellow. Now, if I push END on the debug screen, it does save it right, it's just kind of annoying.
 
Upvote 0
I have Excel 2002 SP3, and it seems to save just fine (granted, I don't have all of the data that you do). I know that doesn't help you any.

What version do you have?
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top