Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Filling empty cells with contents from another cell

I am attempting to create a macro that will allow me to survey a column

of data and fill any empty cells with the input from the corresponding
row of data from another column. As an example:


Store Name Distributor Name


Jiffy JIF
Skippy SKIP
Kraft
Butterball BUTTER


I would want my macro to insert the text "Kraft" into the third row of
data in the distributor column. I have toyed with the following macro,

to little success:


Dim i As Integer
Sheets("Data Mapping").Select
For i = 1 To 104
If Range("C & i + 7").Text = 0 Then
Range("A & i + 7").Select
Selection.Copy
Range("C & i +7").Select
ActiveSheet.Paste
Next i


(I have 104 rows of data that I want to "fill", starting in row 8).
Any input that you might have would be most appreciated. Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Filling empty cells with contents from another cell

Hi Paul

Use this example (almost the same)
http://www.contextures.com/xlDataEntry02.html

--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message ups.com...
I am attempting to create a macro that will allow me to survey a column

of data and fill any empty cells with the input from the corresponding
row of data from another column. As an example:


Store Name Distributor Name


Jiffy JIF
Skippy SKIP
Kraft
Butterball BUTTER


I would want my macro to insert the text "Kraft" into the third row of
data in the distributor column. I have toyed with the following macro,

to little success:


Dim i As Integer
Sheets("Data Mapping").Select
For i = 1 To 104
If Range("C & i + 7").Text = 0 Then
Range("A & i + 7").Select
Selection.Copy
Range("C & i +7").Select
ActiveSheet.Paste
Next i


(I have 104 rows of data that I want to "fill", starting in row 8).
Any input that you might have would be most appreciated. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Filling empty cells with contents from another cell

Sub a()
Dim Cell As Range
On Error GoTo EndThis ''in case no blanks
For Each Cell In Worksheets("Data Mapping") _
.Range("C8:C111").SpecialCells(xlCellTypeBlanks)
Cell.Value = Cell.Offset(0, -1).Value
Next
EndThis:
End Sub


--
Jim
"Ron de Bruin" wrote in message
...
| Hi Paul
|
| Use this example (almost the same)
| http://www.contextures.com/xlDataEntry02.html
|
| --
| Regards Ron de Bruin
| http://www.rondebruin.nl
|
|
| wrote in message
ups.com...
| I am attempting to create a macro that will allow me to survey a column
|
| of data and fill any empty cells with the input from the corresponding
| row of data from another column. As an example:
|
|
| Store Name Distributor Name
|
|
| Jiffy JIF
| Skippy SKIP
| Kraft
| Butterball BUTTER
|
|
| I would want my macro to insert the text "Kraft" into the third row of
| data in the distributor column. I have toyed with the following macro,
|
| to little success:
|
|
| Dim i As Integer
| Sheets("Data Mapping").Select
| For i = 1 To 104
| If Range("C & i + 7").Text = 0 Then
| Range("A & i + 7").Select
| Selection.Copy
| Range("C & i +7").Select
| ActiveSheet.Paste
| Next i
|
|
| (I have 104 rows of data that I want to "fill", starting in row 8).
| Any input that you might have would be most appreciated. Thanks
|
|
|


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Filling empty cells with contents from another cell

I am attempting to create a macro
Oops, thanks Jim

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jim Rech" wrote in message ...
Sub a()
Dim Cell As Range
On Error GoTo EndThis ''in case no blanks
For Each Cell In Worksheets("Data Mapping") _
.Range("C8:C111").SpecialCells(xlCellTypeBlanks)
Cell.Value = Cell.Offset(0, -1).Value
Next
EndThis:
End Sub


--
Jim
"Ron de Bruin" wrote in message
...
| Hi Paul
|
| Use this example (almost the same)
| http://www.contextures.com/xlDataEntry02.html
|
| --
| Regards Ron de Bruin
| http://www.rondebruin.nl
|
|
| wrote in message
ups.com...
| I am attempting to create a macro that will allow me to survey a column
|
| of data and fill any empty cells with the input from the corresponding
| row of data from another column. As an example:
|
|
| Store Name Distributor Name
|
|
| Jiffy JIF
| Skippy SKIP
| Kraft
| Butterball BUTTER
|
|
| I would want my macro to insert the text "Kraft" into the third row of
| data in the distributor column. I have toyed with the following macro,
|
| to little success:
|
|
| Dim i As Integer
| Sheets("Data Mapping").Select
| For i = 1 To 104
| If Range("C & i + 7").Text = 0 Then
| Range("A & i + 7").Select
| Selection.Copy
| Range("C & i +7").Select
| ActiveSheet.Paste
| Next i
|
|
| (I have 104 rows of data that I want to "fill", starting in row 8).
| Any input that you might have would be most appreciated. Thanks
|
|
|




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Filling empty cells with contents from another cell

Ron, I didn't mean to post this to you, sorry. Obviously I saw your post
but after having worked a hard 3 minutes on this I didn't want to throw it
away.<g

--
Jim
"Ron de Bruin" wrote in message
...
| I am attempting to create a macro
| Oops, thanks Jim
|
| --
| Regards Ron de Bruin
| http://www.rondebruin.nl
|
|
| "Jim Rech" wrote in message
...
| Sub a()
| Dim Cell As Range
| On Error GoTo EndThis ''in case no blanks
| For Each Cell In Worksheets("Data Mapping") _
| .Range("C8:C111").SpecialCells(xlCellTypeBlanks)
| Cell.Value = Cell.Offset(0, -1).Value
| Next
| EndThis:
| End Sub
|
|
| --
| Jim
| "Ron de Bruin" wrote in message
| ...
| | Hi Paul
| |
| | Use this example (almost the same)
| | http://www.contextures.com/xlDataEntry02.html
| |
| | --
| | Regards Ron de Bruin
| | http://www.rondebruin.nl
| |
| |
| | wrote in message
| ups.com...
| | I am attempting to create a macro that will allow me to survey a
column
| |
| | of data and fill any empty cells with the input from the
corresponding
| | row of data from another column. As an example:
| |
| |
| | Store Name Distributor Name
| |
| |
| | Jiffy JIF
| | Skippy SKIP
| | Kraft
| | Butterball BUTTER
| |
| |
| | I would want my macro to insert the text "Kraft" into the third row
of
| | data in the distributor column. I have toyed with the following
macro,
| |
| | to little success:
| |
| |
| | Dim i As Integer
| | Sheets("Data Mapping").Select
| | For i = 1 To 104
| | If Range("C & i + 7").Text = 0 Then
| | Range("A & i + 7").Select
| | Selection.Copy
| | Range("C & i +7").Select
| | ActiveSheet.Paste
| | Next i
| |
| |
| | (I have 104 rows of data that I want to "fill", starting in row 8).
| | Any input that you might have would be most appreciated. Thanks
| |
| |
| |
|
|
|
|




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Filling empty cells with contents from another cell

Hi Jim

hard 3 minutes


3 seconds for you <g

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jim Rech" wrote in message ...
Ron, I didn't mean to post this to you, sorry. Obviously I saw your post
but after having worked a hard 3 minutes on this I didn't want to throw it
away.<g

--
Jim
"Ron de Bruin" wrote in message
...
| I am attempting to create a macro
| Oops, thanks Jim
|
| --
| Regards Ron de Bruin
| http://www.rondebruin.nl
|
|
| "Jim Rech" wrote in message
...
| Sub a()
| Dim Cell As Range
| On Error GoTo EndThis ''in case no blanks
| For Each Cell In Worksheets("Data Mapping") _
| .Range("C8:C111").SpecialCells(xlCellTypeBlanks)
| Cell.Value = Cell.Offset(0, -1).Value
| Next
| EndThis:
| End Sub
|
|
| --
| Jim
| "Ron de Bruin" wrote in message
| ...
| | Hi Paul
| |
| | Use this example (almost the same)
| | http://www.contextures.com/xlDataEntry02.html
| |
| | --
| | Regards Ron de Bruin
| | http://www.rondebruin.nl
| |
| |
| | wrote in message
| ups.com...
| | I am attempting to create a macro that will allow me to survey a
column
| |
| | of data and fill any empty cells with the input from the
corresponding
| | row of data from another column. As an example:
| |
| |
| | Store Name Distributor Name
| |
| |
| | Jiffy JIF
| | Skippy SKIP
| | Kraft
| | Butterball BUTTER
| |
| |
| | I would want my macro to insert the text "Kraft" into the third row
of
| | data in the distributor column. I have toyed with the following
macro,
| |
| | to little success:
| |
| |
| | Dim i As Integer
| | Sheets("Data Mapping").Select
| | For i = 1 To 104
| | If Range("C & i + 7").Text = 0 Then
| | Range("A & i + 7").Select
| | Selection.Copy
| | Range("C & i +7").Select
| | ActiveSheet.Paste
| | Next i
| |
| |
| | (I have 104 rows of data that I want to "fill", starting in row 8).
| | Any input that you might have would be most appreciated. Thanks
| |
| |
| |
|
|
|
|




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
filling in empty cells - stumped-in-excel[_2_] Excel Discussion (Misc queries) 7 June 13th 09 07:39 AM
Help on filling empty cells with string + row() John Smith Excel Discussion (Misc queries) 1 July 14th 06 04:44 AM
Filling empty cells with a value Ian Richardson ACITP Excel Discussion (Misc queries) 4 May 17th 06 03:25 PM
Filling in empty cells in columns koba Excel Discussion (Misc queries) 2 November 8th 05 10:03 PM
Filling the first empty cell Rick Excel Programming 2 May 2nd 04 07:10 PM


All times are GMT +1. The time now is 11:18 AM.

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

About Us

"It's about Microsoft Excel"