![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
How can I whrite a macro that delete all the formules in column B (+/- 7000 lines)without deleted the values in the column?
Many thanks. |
|
|
|
|
|
#2 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
Regards,
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: England
Posts: 212
|
The following code will overwrite the formula with the values
Range("A1:A7000").Select Application.CutCopyMode = False Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False HTH Matt |
|
|
|
|
|
#4 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
Quote:
Range("B1:B7000").Select Going with Matt's code, you could try:
Regards,
__________________
Barrie Davidson "You're only given a little spark of madness. You mustn't lose it." - Robin Williams |
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,064
|
How can I whrite a macro that delete all the formules in column B (+/- 7000 lines)without deleted the values in the column? macro that delete all the formules
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi Jack:
Your assumption is that VERLUC's post means that in some cells in column B there are formulas, and in some other cells there are static values -- in that case what you are suggesting will work wonderfully. Barrie and Matt have assumed that VERLUC's post implies that all the cells in column B are formulas and now there is need to convert those into static values and get rid of the formulas -- I believe this is what VERLUC's post implies. VERUC: please post back to confirm what you really want o accomplish.
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
#7 | |
|
New Member
Join Date: Mar 2002
Posts: 3
|
Quote:
Your summary of the suggested solutions is not correct. Jack's solution clears the contents of the cells containing formulas, leaving blank cells. Barrie/Matt's solution converts cells with formulas to values only. (Also, it does not assume all cells contain formulas.) The VBA code to do it could be reduced to :- Columns(2) = Columns(2).Value |
|
|
|
|
|
|
#8 | ||
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
You are right! The code works great too! T H A N K S ! |
||
|
|
|
|
|
#9 | ||
|
Board Regular
Join Date: Mar 2002
Posts: 1,288
|
Quote:
|
||
|
|
|
|
|
#10 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Winnipeg
Posts: 2,330
|
I'm not totally sure of your requirements. If I understand correctly, the following code will take the values in column B and copy them to first blank column from column B (leaving the original formulas in column B).
Is this what you need? _________________ Barrie Davidson My Excel Web Page [ This Message was edited by: Barrie Davidson on 2002-03-26 12:31 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|