Solved

wb.Worksheets(1).Range("A17", "B18", "R19", "S20").Value = "OK" Does not work

Posted on 2016-10-05
3
50 Views
Last Modified: 2016-10-05
i want to use vba to update these non adjacent cells value to "OK"  but this method is not working

wb.Worksheets(1).Range("C17", "C18", "C19", "C20").Value = "OK"

how can i make this work?
0
Comment
Question by:excelismagic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
Subodh Tiwari (Neeraj) earned 500 total points
ID: 41830171
You should try it like this..
wb.Worksheets(1).Range("C17, C18, C19, C20").Value = "OK"

Open in new window

Though the straightforward way would be this...
wb.Worksheets(1).Range("C17:C20").Value = "OK"

Open in new window

0
 
LVL 3

Author Comment

by:excelismagic
ID: 41830207
can this work even if it is non adjacent cells?

liek this Range("C17, D18, R11, W27")
0
 
LVL 31

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41830301
Yes, it will work in that case also.
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question