[RESOLVED] Write to a specific cell
I've got a row selected / activated... now I need to write some data into that selected row.
How would I put the data, say,
temp1 into the selected row's column b
temp2 into the selected row's column c
etc... etc...
then, at the end, i need to select the data in columns a-e (so that it can be pasted into another spreadsheet)...
any ideas on code for this? i'm a complete n00b
Re: Write to a specific cell
i would think this would be *easy* in Excel VBA....
perhaps not though?
Re: Write to a specific cell
For the first part, try this:
VB Code:
Dim lngSelectionRow as Long
lngSelectionRow = Selection.Row
With Worksheets("[U]sheetname[/U]")
.Range("B" & lngSelectionRow).Value = temp1
.Range("C" & lngSelectionRow).Value = temp2
End With
And for the second, either of these:
VB Code:
Worksheets("[U]sheetname[/U]").Range("A" & lngSelectionRow & ":E" & lngSelectionRow).Select
Worksheets("[U]sheetname[/U]").Range("A" & lngSelectionRow & ":E" & lngSelectionRow).Copy Worksheets("[U]target sheetname[/U]").Range("[U]A1[/U]")
Re: Write to a specific cell
works like a champ! thanks!