Populate cells

jabersold

New Member
Joined
Jun 27, 2012
Messages
38
Good Day

What would be the script to populate multiple cells containing different text with the text for a given cell.

Please advise.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi,

1. Can you give an example of what you want to happen? (If we can visually see what has to happen, then it is often easier to formulate an answer.)

2. what is the address of your "given cell" (eg "A1")?

3. what is the address of the cells that this information is to be pasted to? Are they the same cells all the time? Any comments on how they are chosen?

thx

Farmerscott.
 
Upvote 0
Hi,

1. Can you give an example of what you want to happen? (If we can visually see what has to happen, then it is often easier to formulate an answer.)

2. what is the address of your "given cell" (eg "A1")?

3. what is the address of the cells that this information is to be pasted to? Are they the same cells all the time? Any comments on how they are chosen?

thx

Farmerscott.


I'm pulling a report from my wms into excel to check various things like number of open orders. Then column containing the customer name may have many different name/numbers in it. The header will have the customer name in it "C3" and I want to replace all the different text in Column "B1" with the customer name out of "C3". There may only be 15 rows in b or it could be 3000 that I need to replace with the text from "C3"
 
Upvote 0
Hi,

try this on a copy of your data. Please note the comments within the code.

Code:
Sub Change_data()
'All cells in Col C will be replaced with the value in Cell("B1"), including blanks.
Dim lr As Long


'change all "sheet1" references to the name of your sheet.

'Assumes Col C is the longest column.
lr = Worksheets("Sheet1").Cells(Rows.Count, "C").End(xlUp).Row


'Assumes a header in cell("C1").
Worksheets("Sheet1").Range("C2:C" & lr).Value = Worksheets("Sheet1").Range("B1")

End Sub


Farmerscott
 
Upvote 0
Hi,

try this on a copy of your data. Please note the comments within the code.

Code:
Sub Change_data()
'All cells in Col C will be replaced with the value in Cell("B1"), including blanks.
Dim lr As Long


'change all "sheet1" references to the name of your sheet.

'Assumes Col C is the longest column.
lr = Worksheets("Sheet1").Cells(Rows.Count, "C").End(xlUp).Row


'Assumes a header in cell("C1").
Worksheets("Sheet1").Range("C2:C" & lr).Value = Worksheets("Sheet1").Range("B1")

End Sub


Farmerscott


Thank you for the assist
 
Upvote 0

Forum statistics

Threads
1,214,516
Messages
6,119,979
Members
448,934
Latest member
audette89

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