Excel is empty but xlup does select them

paultje_bos

New Member
Joined
Oct 20, 2014
Messages
39
Hi,

I have a sheet with formulas that leaves the cell blank when the result is null (iferror). But when I copy the cells (including blank cells with a formula) and I paste them as value, the empty cells will still be selected when I use ctrl+shift+down. But if I click on the empty cell there is nothing in there, not even the formula (because I pasted it as value).

For some reason Excel still "see" something in the cell.

Reason I ask is because I have a macro that selects data from one sheet (including blank cells with formula), copy and paste them on a different sheet on the first empty row. But the next time I run the marco, the first empty row is not the real empty row because of the problem I mentioned above.

Hope I make some clear. If somebody would have an anwser or work around for me, that would be great.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
This is unfortunately what happens. You need an additional bit of code to loop through the target range after you pasted there and clear the contents of any cells whose value is zero length.
 
Upvote 0
Well the thing is ...
the cell is not really blank after you copied a value in it, even when the value is a zero-lenght string like "".
So the solution would be to do a check of the values you pasted and do .ClearContents on each cell which has a value equal to "".
This will wipe all "balnk" cells and really make them blank. :)
 
Upvote 0
Well the thing is ...
the cell is not really blank after you copied a value in it, even when the value is a zero-lenght string like "".
So the solution would be to do a check of the values you pasted and do .ClearContents on each cell which has a value equal to "".
This will wipe all "balnk" cells and really make them blank. :)

Could you help me a bit more, not an expert, so could you give me the vba code?
 
Upvote 0
Post your current macro code.
 
Upvote 0
Code:
Sub Macro4()
'
' Macro4 Macro
'
'
    Sheets("Sheet2").Select
    Columns("A:K").SpecialCells(xlConstants).EntireRow.Select
    Selection.Copy
    Sheets("FOD MATERIALS IN STORE").Select
    Range("A" & Rows.Count).End(xlUp).Offset(1).Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
Here I should have the code to clearcontents if cell is blank

    Sheets("GR Import").Select
    Range("A2:G1129").Select
    Application.CutCopyMode = False
    Selection.ClearContents
    Range("A2").Select
    Sheets("FOD MATERIALS IN STORE").Select
End Sub
 
Last edited by a moderator:
Upvote 0
paultje_bos,

Try......

Rich (BB code):
Sub Macro4()
'
' Macro4 Macro
'
'
Sheets("Sheet2").Select
Columns("A:K").SpecialCells(xlConstants).EntireRow.Select
Selection.Copy
Sheets("FOD MATERIALS IN STORE").Select
Range("A" & Rows.Count).End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False


Selection.TextToColumns


Sheets("GR Import").Select
Range("A2:G1129").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A2").Select
Sheets("FOD MATERIALS IN STORE").Select
End Sub

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top