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.
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
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