+ Reply to Thread
Results 1 to 5 of 5

Copying cells till blank rows end

  1. #1
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Copying cells till blank rows end

    Hi all,

    I have data in A2, then blank till A18 (variable number each time), then data in A19 and blank till A35 (and more and more).

    Using VBA how would I code to copy A1 into every cell till A18, then copy A19 into every cell till A35 and so on.

    Perhaps using SpecialCells(xlTypeConstant) or something?

    Thanks in adance

    Seamus

  2. #2
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Should have done some more searching before posting - I found the answer.

    Please Login or Register  to view this content.
    Hope this helps

    Seamus

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not adapt the code that I gave you earlier?

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650
    Hi Here's an alternative
    Please Login or Register  to view this content.
    Regards Mick

  5. #5
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Roy,

    That code appears to say:

    If A2 is not empty then A3's value = A1's Value.

    So if I have data in A2 and want it copied down to A10 your code takes A1's value (header cell) and places it in A3, then takes A2's value (hospital name) and places it in A4 and so on.

    Sorry

    Seamus

+ 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. Count including Blank Cells
    By bhofsetz in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-17-2015, 02:11 PM
  2. Exclude Blank cells when matching against other cells.
    By Neil07979 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-05-2008, 09:28 AM
  3. Compressing data or Trimming Blank Rows
    By all4excel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-07-2008, 07:28 AM
  4. Repeat data in blank cells
    By mackey in forum Excel General
    Replies: 2
    Last Post: 02-06-2008, 09:18 AM
  5. Excel doesn't think blank cells are not really blank?
    By leonnord in forum Excel General
    Replies: 3
    Last Post: 08-01-2007, 02:34 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