Solved

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

Posted on 2016-10-05
3
33 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
  • 2
3 Comments
 
LVL 28

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 28

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Modern/Metro styled message box and input box that directly can replace MsgBox() and InputBox()in Microsoft Access 2013 and later. Also included is a preconfigured error box to be used in error handling.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

930 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now