The Most Simple Question Ever

A

Angyl

Hi, I'm not exatly new to VBasic, I've spent some time working with it in
Word (forms) but NEVER in Excel, and now it's time for me to get started
knowing how to work in Excel.

So the basic question is, how do I reference cells in vBasic (Excel?)

For example, how would I write:

If (cell A1) = "test" Then
(cell D24) = "It worked!"

This fundamental knowledge along with what I know from Word ought to be
enough to get me started on some projects...

Thanks!
 
J

JE McGimpsey

XL cells are Range Objects. One way:

If Range("A1").Value = "test" Then _
Range("D24").Value = "It worked"

An alternative:

If Cells(1, 1).Text = "test" Then _
Cells(24, 4).Value = "It worked"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top