Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

Question regarding Visual Basic

  • Please log in to reply




  • Member
  • PipPipPip
  • 335 posts
Hi all, hope somebody can help with this one.

If I have two cells selected on a spreadsheet, how can I get VB to identify and manipulate the cells independently of each other?

Most of the commands I use regularly, cell, range etc only expose the active cell to VB.
  • 0





  • Member
  • PipPip
  • 22 posts
I believe that examining the Range.(Reference).Cells(Row,Column).<Insert Your Function Call Here> method under the Range Object in Help should be of use. There might be a better way, but that's a technique that I've used in the past.

From the file:

Visual Basic for Applications
Worksheets(1).Range("C5:C10").Cells(1, 1).Formula = "=Rand()"

Use Range(cell1, cell2), where cell1 and cell2 are Range objects that specify the start and end cells, to return a Range object. The following example sets the border line style for cells A1:J10.

  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP