Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default If statement not working right

I have an if statement that if range name "tax_r" = true then column E should
be hidden.
I believe that there is a problem with my code and I can't see it.

Private Sub Enter_Click()

Worksheets("Intro").Visible = False

Sheet3.Activate
frm_Data.Show vbModeless

Dim TaxType As String
With Worksheets("vlookup")

TaxType = .Range("Tax_r").Value

End With

If TaxType = "TRUE" Then
Columns("E:E").Select
Selection.EntireColumn.Hidden = True
Range("A2").Select
End If


End Sub


Can someone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default If statement not working right

The problem is column E will not hide when the condition is met.

"TimT" wrote:

I have an if statement that if range name "tax_r" = true then column E should
be hidden.
I believe that there is a problem with my code and I can't see it.

Private Sub Enter_Click()

Worksheets("Intro").Visible = False

Sheet3.Activate
frm_Data.Show vbModeless

Dim TaxType As String
With Worksheets("vlookup")

TaxType = .Range("Tax_r").Value

End With

If TaxType = "TRUE" Then
Columns("E:E").Select
Selection.EntireColumn.Hidden = True
Range("A2").Select
End If


End Sub


Can someone help?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default If statement not working right

If TaxType = "TRUE" Then
sheet3.Columns("E:E").Select
Selection.EntireColumn.Hidden = True
Sheet3.Range("A2").Select
End If

--
Regards,
Tom Ogilvy

"TimT" wrote in message
...
I have an if statement that if range name "tax_r" = true then column E

should
be hidden.
I believe that there is a problem with my code and I can't see it.

Private Sub Enter_Click()

Worksheets("Intro").Visible = False

Sheet3.Activate
frm_Data.Show vbModeless

Dim TaxType As String
With Worksheets("vlookup")

TaxType = .Range("Tax_r").Value

End With

If TaxType = "TRUE" Then
Columns("E:E").Select
Selection.EntireColumn.Hidden = True
Range("A2").Select
End If


End Sub


Can someone help?



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
IF Statement not working steve12173 Excel Worksheet Functions 7 June 18th 09 06:44 PM
IF Statement not working Barrett M Excel Worksheet Functions 8 May 6th 08 03:29 PM
If statement working only once Lime Excel Worksheet Functions 0 May 5th 08 03:58 AM
If Statement Not Working Telegirl Excel Worksheet Functions 9 May 12th 07 04:34 PM
IF statement not working TJAC Excel Discussion (Misc queries) 2 January 13th 06 01:08 PM


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