Results 1 to 8 of 8

Computer Name

Threaded View

  1. #1
    Registered User
    Join Date
    08-25-2016
    Location
    stoke, England
    MS-Off Ver
    office 2013
    Posts
    5

    Computer Name

    **EDITTED - thought id did it in the first place**

    I am looking a spreadsheet with userform to print labels.

    I am looking at the same spreadsheet but the label printers are of three make and therefore have 3 different name. I am looking at using the Computer Name to pick the correct print name. Also looking at displaying the Computer Name on the Userform


    Code so far

    Private Sub frmLABELS_Initialize()
      
    
    Dim strHostName As String
    
    strHostName = Environ("ComputerName")
    
    . 
    .
    .
    .
    
        Label9.Caption = strHostName.Value
        
    End Sub
    
    -------------------------------------------------------------------------------
    
    Private Sub cmdMORE_Click()
    
    .
    .
    .
    .
    
    Dim strDefaultPrinter As String
    Dim strLabelPrinter As String
    
    If strHostName = "NSHxxxxx1" Then
                 strLabelPrinter = "ZDesigner GK420t"
                 
       ElseIf strHostName = "NSHxxxxx2" Then
                 strLabelPrinter = "ZDesigner TLP 2844"
                 
        ElseIf strHostName = "NSHxxxxx3" Then
                 strLabelPrinter = "Zebra  TLP2844"
                 
       Else: strLabelPrinter = Application.ActivePrinter
      
    End If
    
    Worksheets("Sheet1").Range("B10") = frmLABELS.cboCLINIC.Value
    Sheets("Sheet1").Range("A1:B4").PrintOut ActivePrinter:=strLabelPrinter, Copies:=txtNO.Value
    Application.ActivePrinter = strDefaultPrinter
    
    End Sub
    I think this should work but when tested no it didnt.. Please Help... Where am I going wrog?
    Last edited by maclevey; 08-26-2016 at 05:18 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ask about buy a old computer
    By ninhmoon in forum The Water Cooler
    Replies: 2
    Last Post: 11-04-2015, 05:37 AM
  2. VLookup works in my computer, but not in another user computer.
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2013, 04:41 PM
  3. Replies: 6
    Last Post: 06-28-2013, 08:44 PM
  4. Replies: 1
    Last Post: 06-30-2012, 02:03 PM
  5. Replies: 0
    Last Post: 02-08-2010, 03:17 PM
  6. Auto Filter on my home computer differs from my work computer.
    By Sbova0226 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-08-2009, 03:04 PM
  7. Replies: 2
    Last Post: 12-19-2005, 11:23 PM

Tags for this Thread

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