LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Doing it's own thing

Have a macro that keeps deleting what i have in the cell
A1 which is streched over a range of columns but also
deleting all the column headings that i have from B2 to J2.
The macro is supposed to rename 5 of the columns and
delete 4. What i endup with is an almost empty page
except for the heading for the last column (f2). Here is
the code. (now just to note that the if statement that i
use is actually =if(listoptions!B2="","",listoptions!b2)
and not what is showing up in the code for some reason)

A.

Range("B2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ListOptions!R[-1]C[-1]="""","""",ListOptions!R
[-1]C[-1])"
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ListOptions!R[-1]C[-1]="""","""",ListOptions!R
[-1]C[-1])"
Range("D2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ListOptions!R[-1]C[-1]="""","""",ListOptions!R
[-1]C[-1])"
Range("E2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ListOptions!R[-1]C[-1]="""","""",ListOptions!R
[-1]C[-1])"
Columns("F:F").Select
Range("F2").Activate
Selection.Delete Shift:=xlToLeft
Columns("G:I").Select
Range("G2").Activate
Selection.Delete Shift:=xlToLeft
Range("F2").Select
ActiveCell.FormulaR1C1 = _
"=IF(ListOptions!R[-1]C[-1]="""","""",ListOptions!R
[-1]C[-1])"
End Sub

 
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
not sure if i'm using the right thing Tiffany Excel Worksheet Functions 4 September 19th 08 05:21 PM
Oh, just one more thing Mike[_12_] Excel Discussion (Misc queries) 1 July 27th 08 04:32 AM
One Last Thing Coltsfan Excel Discussion (Misc queries) 1 January 16th 06 08:42 PM
Is there such a thing... Tom Excel Discussion (Misc queries) 1 April 19th 05 01:38 AM
New to this thing BowD Excel Programming 2 December 19th 03 03:29 AM


All times are GMT +1. The time now is 04:38 PM.

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"