Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Plumdodge
 
Posts: n/a
Default Replace Null value in Coloumn

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   Report Post  
Bob Phillips
 
Posts: n/a
Default Replace Null value in Coloumn


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   Report Post  
Plumdodge
 
Posts: n/a
Default Replace Null value in Coloumn

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multipying columns that contail null values ChuckW Excel Discussion (Misc queries) 1 September 7th 05 01:13 AM
Replace null string with blank cell gjcase Excel Discussion (Misc queries) 2 August 9th 05 02:13 PM
Search and replace Subu Excel Worksheet Functions 4 June 9th 05 07:01 PM
replace absolute references bj Excel Worksheet Functions 0 May 20th 05 07:18 PM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"