LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default How do I sort worksheet without affecting formula values?

I feel your pain. I've ran into the same issue before.

The problem is the use of worksheet functions. The solution is DO NOT USE
worksheet functions. Use a VBA subroutine instead.

Here is an example:

With worksheet functions....

A B C
1 2 3 6(formula =A1*B1)
2 4 5 20(formula =A2*B2)
3 6 7 42(formula =A3*B3)
..
..

Without worksheet functions, using VBA Sub....

A B C (Start
Button)
1 2 3
2 4 5 User clicks
the start button and the macro runs.
3 6 7

A B C (Start
Button)
1 2 3 6
2 4 5 20
3 6 7 42

The Macro Code

Sub MultiplyMyNumbers()

For MyRow=1 to 3

Worksheets("Sheet1").Range("C"+Cstr(MyRow)).Value =
Worksheets(("Sheet1").Range("A"+Cstr(MyRow)).Value *
Worksheets(("Sheet1").Range("B"+Cstr(MyRow)).Value

Next MyRow

End Sub





"HELP PLEASE!" <HELP wrote in message
...
I have two worksheets, one of which has formulas which reference the
other.
The problem is, I cannot sort the first worksheet and have the formula
values
in the second worksheet follow it so the values stay the same. I have
tried
making them absolute references ($A$1) but it doesn't help.


 
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
Sort a data without affecting the scatter chart Piyush[_2_] Charts and Charting in Excel 1 August 5th 09 04:42 AM
Replace worksheet without affecting the referencing formula Jay Excel Discussion (Misc queries) 1 May 7th 09 03:11 AM
I'd like to Sort one column without affecting the others Legna105 Excel Worksheet Functions 5 October 2nd 07 11:54 PM
How can I sort data without affecting formula? vickis Excel Discussion (Misc queries) 3 January 10th 07 03:57 AM
sort worksheet without affecting workbook Barry Excel Worksheet Functions 3 November 2nd 05 10:06 PM


All times are GMT +1. The time now is 02:43 AM.

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"