Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
blank cells
Hello,
What I would like to do is go through a list in excel. If the cell is blank, then the value above the blank cell should be pasted onto that cell. The process i've written works for only the cell that is right below the value. What if there is more than one blank cell? I started experimenting with setting up a conditional statement If Null, Then... but it does not seem to work. How can I differentiate between blank cells and cells with values in my code? thanks for your help! Marta Dim blankcell As Integer blankcell = 1 Dim ticker As String ticker = Cells(blankcell, 1) Do Until Cells(blankcell, 1) = "Totals" If Cells(blankcell, 1) = Null Then blankcell = blankcell - 1 Cells(blankcell, 1).Select Selection.Copy blankcell = blankcell + 1 Cells(blankcell, 1).Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Else If Cells(blankcell, 1) = ticker And Cells(blankcell, 1).Offset(1, 0) = "" Then Cells(blankcell, 1).Select Selection.Copy blankcell = blankcell + 1 Cells(blankcell, 1).Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False End If End If blankcell = blankcell + 1 ticker = Cells(blankcell, 1) Loop |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Index/match - make blank cells return a blank value. | Excel Worksheet Functions | |||
Excel 2002: Return blank when VLOOKUP on blank cells | Excel Discussion (Misc queries) | |||
Nested IF - return a blank when compared cells are blank | New Users to Excel | |||
Maximum Number of Blank Cells between Non Blank Cells in a Range | Excel Worksheet Functions | |||
Imported Data creates blank cells that aren't really blank | Excel Worksheet Functions |