+ Reply to Thread
Results 1 to 2 of 2

Macro to fill cells

  1. #1
    Registered User
    Join Date
    07-21-2017
    Location
    Bratislava, Slovakia
    MS-Off Ver
    2013 going to 365
    Posts
    1

    Macro to fill cells

    Hello everybody,
    I am not creator of this macro, just found it online and modify a little to fill text from one cell to others in column:
    Sub fillup()
    *
    Dim lLastRow As Long
    Dim lCounter As Long
    Dim sThisCust As String
    *
    lLastRow = Cells(Rows.Count, "c").End(xlUp).Row
    *
    sThisCust = Cells(1, "c")
    *
    For lCounter = 2 To lLastRow
    *
    If Trim((Cells(lCounter, "c")) = "") Then
    *
    Cells(lCounter, "c") = sThisCust
    Else
    sThisCust = Cells(lCounter, "c")
    End If
    Next
    *
    End Sub

    Now it stopped working any idea what can be problem. Compile error: Sub or Function not defined.

    I am using office 2013 and planning to go to 365. I need something very easy to copy text after I unmerge cells and I have no idea how to wright macros.
    Thanks a lot for any answer.
    Loksha

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Macro to fill cells

    Please use code tags when posting code.

    Which line is shown to be in error when you run the code?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Skip x cells and fill (Fill/create weekly average from 7 days and fill down)
    By tunafishes in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-18-2016, 03:43 AM
  2. Fill cells with Macro from IF statement
    By kingofbeans in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2013, 01:41 AM
  3. Macro to fill value in one of the three cells
    By aadeshgandhi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-13-2013, 07:21 PM
  4. [SOLVED] Macro to auto fill in cells based on value on different cells
    By juskojj in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-11-2013, 01:35 PM
  5. Macro to fill empty cells below
    By applegatecz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2010, 01:50 PM
  6. Macro to insert row/fill cells
    By manny_cb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2008, 06:46 PM
  7. Macro to fill in blank cells
    By ChrisF79 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-07-2008, 02:41 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