PDA

View Full Version : dynamically write data in cell



ilyaskazi
06-17-2005, 11:18 PM
below is the code for which i am using it by moving the cursor and writing the data on selected cell. I need to write dynamically without moving


For Each na In cSheets

Sheets("RESULT").Select
ActiveCell.value = na.Name
ActiveCell.Offset(0, 1).Select
ActiveCell.value = ce.Address(False, False)
ActiveCell.Offset(0, 1).Select
ActiveCell.value = ce.Text
ActiveCell.Offset(0, 1).Select
ActiveCell.value = "" + Sheets(na & 2).Range(ce.Address).Text
ActiveCell.Offset(1, -3).Select

Next na

Norie
06-18-2005, 05:53 AM
What exactly do you mean?

Can we see the rest of the code?

For Each na In cSheets

Set rng = Sheets("RESULT").ActiveCell
rng.Value = na.Name
rng.Offset(0, 1).Value = ce.Address(False, False)
rng.Offset(0, 2).Value = ce.Text
rng.Offset(0, 3).Value = Sheets(na & 2).Range(ce.Address).Text
Set rng = rng.Offset(1, 0)

Next na