Results 1 to 3 of 3

Help with excel 2013 vba code to Count and assign a number.

Threaded View

  1. #1
    Registered User
    Join Date
    02-01-2014
    Location
    Wisconsin
    MS-Off Ver
    Excel 2013
    Posts
    2

    Help with excel 2013 vba code to Count and assign a number.

    Hi all,

    I am working with excel 2013 and vba. I have created a form to utilize for entering data into a list that I am in need of some assistance with. The form itself works just fine I am just trying to add another little feature to it. What I am trying to accomplish is when the workbook is opened and the form opens there is a field that is automatically populated with the next sequential number. Or at least assign a number to that row to be filled.

    I have tried the following code, but get an error of "type mismatch"

    Dim k, i As Long, n As Long
         
        With Range("a12:d" & Range("a" & Rows.Count).End(xlUp).Row)
            k = .Value
            For i = 1 To UBound(k, 1) <--------line I get "Type mismathch"
                If Len(k(i, 1)) = 0 Then
                    n = n + 1
                    k(i, 1) = n
                End If
            Next
            .Value = k
        End With
    Any help would be great. Thank you in advance.
    Red1976
    Last edited by Red1976; 02-01-2014 at 01:46 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Simple formula to display a date (10/19/2013) as text (October 2013)
    By benyben123 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2013, 03:47 AM
  2. excel 2013 and autocad 2013 LT
    By drailed in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-25-2013, 03:05 PM
  3. Replies: 3
    Last Post: 09-12-2013, 06:23 PM
  4. Link Excel 2013 to Word 2013
    By drosen99 in forum Word Formatting & General
    Replies: 20
    Last Post: 02-26-2013, 08:20 PM
  5. Replies: 2
    Last Post: 11-04-2012, 04:57 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