Results 1 to 3 of 3

Cells function error

Threaded View

  1. #1
    Registered User
    Join Date
    11-21-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2013
    Posts
    10

    Cells function error

    Hi

    I have created a macro (see below) to include empty rows based on a cell value in the 3rd column. This macro works fine as long as I begin my data in the cells A1.

    However, when my range starts in a different column then A, the macro does not work. I tried to make adjustments in the "Cells" function (for example by entering a cellreference there but it doesn't work). Can anyone help me what I should enter in the Cells function if I want it to change to other columns? (what I tried is changing the "1" in the first Cells formula but it didn't work). Thanks in advance



    Sub Test()
    
    For N = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
        If Cells(N, 3) <> "" And Cells(N, 3) <> 1 Then
            Rows(N + 1 & ":" & N + Cells(N, 3) - 1).Insert
        End If
    Next N
    End Sub
    Last edited by Brython; 10-08-2014 at 04:44 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Index Match Function Within One Workbook Referencing Cells in Another workbook error
    By Hackboss007 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-18-2014, 12:06 PM
  2. [SOLVED] IF Function Error When Calculating Blank Cells
    By dcuesta in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-04-2014, 02:41 PM
  3. how to use find function to locate error cells?
    By perfection in forum Excel General
    Replies: 1
    Last Post: 10-24-2010, 10:52 PM
  4. [SOLVED] Average function with #VALUE! error in reference cells
    By Larry4500 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-16-2006, 05:50 AM
  5. Error in sum function when using merged cells
    By librarynut in forum Excel General
    Replies: 0
    Last Post: 09-13-2005, 02:19 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