Results 1 to 5 of 5

getting rid of blank cells

Threaded View

HardEngineering getting rid of blank cells 03-30-2014, 11:48 AM
Kaper Re: getting rid of blank cells 03-30-2014, 01:03 PM
HardEngineering Re: getting rid of blank cells 04-03-2014, 11:53 AM
Kaper Re: getting rid of blank cells 04-03-2014, 12:52 PM
HardEngineering Re: getting rid of blank cells 04-03-2014, 12:59 PM
  1. #1
    Registered User
    Join Date
    03-30-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    getting rid of blank cells

    Hi, I'm a noob here
    I have 3 rather large worksheets I am working with in a workbook (actually there are around 60 worksheets).
    Worksheet 1 has a range from C35:C1534.
    Let's say I have a numeric value in 35 of those cells.
    Worksheet 2 uses formulas (in cells J7:J1506 and K7:K1506) to look at the values of cells C35:C1534 on Worksheet 1. Let's say we are looking for the value "1".
    On Worksheet 2 I have defined a maximum number of entries with the value "1" per column (let's say that maximum number is "24")
    If data with the value "1" is entered into more than 25 cells on Worksheet 1 in column C (which in our case is true) it splits that data on Worksheet 2 (where we start at row 7), putting roughly half the data (18 cells of data) in column A in cells J7:J25, and the remaining data into Column K (17 cells of data) in cells K26:K43; this leaves cells J26:J1506, and cells K1:K18 and K44:K1506 on Worksheet 2 "empty".
    I am using VBA to copy the data for columns J7:J1506 and K7:K1506 onto Worksheet 3 in Columns B7:J1506 and C7:K1506.

    I've explained all of that to say this- On Workbook 3, I want all data to start in their columns (B and C in our example) at row 7, filling down. When I copy and paste the data from Worksheet 2 to Worksheet 3, it always brings in some form of blank cell data from Workbook 2 to Workbook 3. I can remove this blank data by manually selecting (for example) from C7 to C25, and using ClearContents. I could do this, but in actuality, I have data all the way to column QR (like I said, it's a large workbook), and so this becomes very tedious and time consuming, so naturally I want VBA to do this. I know that the problem is caused when I copy in the range of data from Workbook 2 to Workbook 3 (it brings in blank cell data) because I can clear the cell contents of Workbook 3 and all is good, but as soon as I copy the data in from Workbook 2, the blank cell data comes in also . I have tried everything I can think of, and it still brings in blank cell data. I use Range("B7:B1506").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=True, Transpose:=False

    So using PasteSpecial (as shown above) it should be pasting nothing into Worksheet 3 but values (perhaps it is selecting null "" values?) and Skipping Blanks, but the problem persists. My secondary issue is that across the columns, data keeps getting pushed further and further down the sheet, so to find the cells with "real" values, by the time I get to column QR (in reality) I am having to look for data all the way down to row 1534; as you can see, this gets very time consuming, even for VBA.
    Please help, and TIA
    Last edited by HardEngineering; 03-30-2014 at 11:51 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to fill blank cells in column A based on non-blank cells
    By ktalamantez in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2014, 02:47 PM
  2. [SOLVED] Delete special blank cells not recognising blank cells
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-04-2013, 03:54 AM
  3. Replies: 5
    Last Post: 08-26-2013, 06:26 PM
  4. How can I make a macro ignore blank cells? - Blank Cells have formulas
    By mz1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-30-2013, 08:54 AM
  5. Advanced filter with blank cells / Dynamic named range with blank cells
    By Jason_2112 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2010, 12: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