Solved

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

Posted on 2016-10-05
3
42 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 30

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 30

Expert Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
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…

830 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