Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

output to cells to in excel

Status
Not open for further replies.

wdverner

Technical User
Mar 10, 2005
160
GB
Hi all,
I ahve this macro:

Dim r As Integer, c As Integer, n As Integer
For r = 2 To 5
n = 0
For c = 1 To 10
If Cells(1, c) <> Cells(r, c) Then n = n + 1
Next c
If n Then MsgBox "Row 1...." & r & "=" & n & " Parts different"
Next r

Rather than output it in a MsgBox is it possible to output it into cells in the worksheet:

A1 A2
Row 1....2 10 Parts different
Row 1....3 5 Parts different

And so on until all rows are output?

Many thanks for suggestions....
 
Please post queries like this in the VBA Visual Basic for Applications (Microsoft) Forum forum707



Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
ClennUK is correct there is a fourm for these questions. How ever...

cells(i,j).value="Your text here"
where i,j is the address for the cell you want to output to.

Hope this helps.

Kevin Petursson
--
"Everyone says quotable things everyday, but their not famous... so nobody cares."... Some Person
 
Except that the requirement actually reads as if wdverner wants the output to overwrite the cells being tested.

The code will need to have the sheet object referenced for the output too.


Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top