Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I am relatively new to Excel VBA and work primarily with Access. For a
spreadsheet which require frequent importation into Access I need to replace all null cells in Coloumn A with the value from the cell directly above it. I.E. A B C 1 45 2 Null I would want to replace the blank cell of A2 with the value of 45 from A1. This macro would go through a various range because the number of rows vary in length. It would just need to stop at the last row that has a value present in Coloumn A. Any ideas or suggestions? |
#2
![]() |
|||
|
|||
![]() For i = 2 To Cells(Rows.Count,"A").End(xlUp).Row If Cells(i,"A").Value = "" Then Cells(i,"A").Value = Cells(i-1,"A").Value End If Next i -- HTH RP (remove nothere from the email address if mailing direct) "Plumdodge" wrote in message ... I am relatively new to Excel VBA and work primarily with Access. For a spreadsheet which require frequent importation into Access I need to replace all null cells in Coloumn A with the value from the cell directly above it. I.E. A B C 1 45 2 Null I would want to replace the blank cell of A2 with the value of 45 from A1. This macro would go through a various range because the number of rows vary in length. It would just need to stop at the last row that has a value present in Coloumn A. Any ideas or suggestions? |
#3
![]() |
|||
|
|||
![]()
Bob,
Thank you very much for the Help! "Bob Phillips" wrote: For i = 2 To Cells(Rows.Count,"A").End(xlUp).Row If Cells(i,"A").Value = "" Then Cells(i,"A").Value = Cells(i-1,"A").Value End If Next i -- HTH RP (remove nothere from the email address if mailing direct) "Plumdodge" wrote in message ... I am relatively new to Excel VBA and work primarily with Access. For a spreadsheet which require frequent importation into Access I need to replace all null cells in Coloumn A with the value from the cell directly above it. I.E. A B C 1 45 2 Null I would want to replace the blank cell of A2 with the value of 45 from A1. This macro would go through a various range because the number of rows vary in length. It would just need to stop at the last row that has a value present in Coloumn A. Any ideas or suggestions? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multipying columns that contail null values | Excel Discussion (Misc queries) | |||
Replace null string with blank cell | Excel Discussion (Misc queries) | |||
Search and replace | Excel Worksheet Functions | |||
replace absolute references | Excel Worksheet Functions | |||
VB Find and Replace | Excel Worksheet Functions |