Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. selecting cells based on variables

selecting cells based on variables

Scheduled Pinned Locked Moved Visual Basic
toolshelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Matthew Leggett
    wrote on last edited by
    #1

    Hi folks I am using Visual Basic script and I need to select a range based on one of the following notation Worksheets(SetMonth).Range($D$8:$D$24).Select StartLocation = "$D$8" EndLocation = "$D$24" Worksheets(SetMonth).Range(" & StartLocation & ":" & EndLocation & ").Select Both of the above seem to work with other formulations however I don't seem to be able to use either of the above to select the range of cells required. Can Anyone help

    W 1 Reply Last reply
    0
    • M Matthew Leggett

      Hi folks I am using Visual Basic script and I need to select a range based on one of the following notation Worksheets(SetMonth).Range($D$8:$D$24).Select StartLocation = "$D$8" EndLocation = "$D$24" Worksheets(SetMonth).Range(" & StartLocation & ":" & EndLocation & ").Select Both of the above seem to work with other formulations however I don't seem to be able to use either of the above to select the range of cells required. Can Anyone help

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Matthew Leggett wrote:

      Worksheets(SetMonth).Range(" & StartLocation & ":" & EndLocation & ").Select

      Is that the full code line, since it doesn't make sense. Starting and ending quotation marks don't match. If this is Excel VBA, it would look something like:

      Worksheets("SetMonth").Range(StartLocation & ":" & EndLocation).Select

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups