Results 1 to 3 of 3

Code not working

Threaded View

zplugger Code not working 03-19-2015, 07:31 AM
simcode Re: Code not working 03-19-2015, 08:11 AM
zplugger Re: Code not working 03-19-2015, 08:32 AM
  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Code not working

    Trying to set position of listbox on two different computers.I want to use a checkbox to set position between labtop and desktop.
    Thinking something is wrong with the way I did IF function.
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim ws As Worksheet
    Set ws = ActiveSheet
    If CheckBox1 = True Then
    Me.ListBox1.Value = ""
    With ActiveWindow.VisibleRange
    ListBox1.Top = .Top + 235
    ListBox1.Left = .Left + .Width - ListBox1.Width - 378
    End If
    Else
     Me.ListBox1.Value = ""
    With ActiveWindow.VisibleRange
    ListBox1.Top = .Top + 35.25
    ListBox1.Left = .Left + .Width - ListBox1.Width - 250
    
    End With
    End Sub
    Last edited by zplugger; 03-19-2015 at 08:33 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Pattern Building VBA Code - Working code, would like to use cleaner code
    By Benisato in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-10-2015, 03:05 PM
  2. [SOLVED] Vba code working in workbook module but not working from personal.xlb
    By satputenandkumar0 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-19-2014, 05:47 AM
  3. Replies: 1
    Last Post: 11-13-2013, 10:28 AM
  4. [SOLVED] VBA Code (colums to row, autofill) stop working in row 294 when new cable code appear
    By sknifseht in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2012, 05:27 AM
  5. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1