Results 1 to 6 of 6

Problem Inserting Value Into Cell

Threaded View

  1. #1
    Registered User
    Join Date
    01-17-2024
    Location
    Macomb, Michigan
    MS-Off Ver
    Current
    Posts
    43

    Problem Inserting Value Into Cell

    Below is code that completely works... with the exception of line highligeted in Red. I get a run-time error 1004. I've tried every thing with my very limited VBA knowlege. Help!
    Steve
    Private Sub Workbook_Activate()
    'Stop
        Dim chkBox As Excel.CheckBox
        'Finds Windows UserProfile
        Worksheets(1).Range("H56").Value = Environ("userprofile")
        Application.ScreenUpdating = False
        'Clears Req'd Cells
        If ThisWorkbook.Name = "BSB Elevate Quote v4.xlsm" Then
            'Clear Contact Info Tab
            Sheets("Contact Info").Activate
            With Sheets("contact info")
            .Range("C6:C8,C10:C13,C15:C17,C24,C55").ClearContents
            'Inserts Formula for Rep Name
            .Range("C20").Formula = "=D109"
            'Inserts 1 for Site Qty
            .Range("C7").Select
            'Clear Elevate Pricing Tab
            Sheets("elevate pricing").Activate
            End With
            With Sheets("elevate pricing")
            .Range("W4").Value = 1
            .Range("D7:D163,J7:J163,O7:O163").ClearContents
            'Clear Labor Changes (Col V)
            Range("v174").Copy
            Range("V84:V91,V93:V118,V120:V135,V137:V138,V140:V159,V161:V163").PasteSpecial xlPasteFormulas
            Application.CutCopyMode = False
            'Clear Check Box 1
            ActiveSheet.CheckBoxes("Check Box 1").Value = xlOff
            .Range("B7").Select
            'Clear Keysheet Tab
            Sheets("keysheet").Activate
            End With
            With Sheets("keysheet")
            .Range("C7:R252").ClearContents
            .Range("B6").Select
            'Clear Notes Tab
            Sheets("notes").Activate
            End With
            With Sheets("Notes")
            .Range("C6:C55").ClearContents
            .Range("B5").Select
            'Activate Contact Info Tab
            Sheets("Contact Info").Activate
            '.Range("C7").Select
            End With
        End If
        Application.ScreenUpdating = True
        'Application.DisplayAlerts = False
    End Sub
    Last edited by StevenRK72; 03-09-2024 at 12:41 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Problem inserting pagebreak
    By arian29 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-07-2015, 04:05 AM
  2. Problem When Inserting & Deleting a Row
    By timbo1957 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-17-2012, 01:27 PM
  3. Problem with inserting formula in cell with VBA
    By Keva in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-23-2010, 03:43 AM
  4. Help with inserting row problem
    By Stuwally in forum Excel General
    Replies: 3
    Last Post: 01-17-2007, 09:00 PM
  5. little problem with inserting a formula
    By furbiuzzu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-03-2006, 08:10 AM
  6. Problem inserting a column!!!
    By londonchick in forum Excel General
    Replies: 2
    Last Post: 09-05-2005, 09:05 AM
  7. Help: Problem inserting HTML into a single cell
    By M.L. in forum Excel General
    Replies: 0
    Last Post: 07-08-2005, 06:05 PM

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