Results 1 to 6 of 6

Adding a new number row but clearing contents of new role

Threaded View

Armored Wing Adding a new number row but... 09-11-2014, 05:33 PM
stnkynts Re: Adding a new number row... 09-11-2014, 05:53 PM
Armored Wing Re: Adding a new number row... 09-11-2014, 05:56 PM
xladept Re: Adding a new number row... 09-11-2014, 07:36 PM
Armored Wing Re: Adding a new number row... 09-11-2014, 10:21 PM
xladept Re: Adding a new number row... 09-11-2014, 11:18 PM
  1. #1
    Registered User
    Join Date
    09-08-2011
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    20

    Adding a new number row but clearing contents of new role

    Hi all, I am currently working on a mini excel project where I need to add a new numbered row (i.e 2 to 3 to 4) but with my new rows having cleared contents.

    My code right now is the following and I can' t remember how to add the number row. Any help is greatly appreciated. Thank you.

    Private Sub CommandButton1_Click()
    
     Dim varUserInput As Variant
     varUserInput = InputBox("Enter Row Number where you want to add a row:", _
      "What Row?")
     If varUserInput = "" Then Exit Sub
    
    RowNum = varUserInput
        Rows(RowNum & ":" & RowNum).Insert Shift:=xlDown
        Rows(RowNum - 1 & ":" & RowNum - 1).Copy Range("A" & RowNum)
        Range(RowNum & ":" & RowNum).ClearContents
        
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Adding number to a cell reference not to the contents
    By Go Buckeyes! in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2014, 09:08 AM
  2. VBA Clearing Sheet Contents
    By bkeat in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-18-2013, 12:35 PM
  3. Clearing Contents
    By makku in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2011, 05:23 AM
  4. Clearing Contents ?
    By Mhz in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 01-21-2007, 11:20 AM
  5. Clearing Contents
    By Sean in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-06-2005, 01:06 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