Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Use a value in a For Selection loop

Posted on 2014-07-22
2
Medium Priority
?
85 Views
Last Modified: 2014-07-22
How do I name a cell, (want H6 to be MatlNumber), so the value can be used in a different part of a spreadsheet?
This is the tail end of a For Selection loop, and after I select H6, I want to go back to the selection "C" and place the value that was there, two columns to the right of the selection it is working on.

        
       Range("H6").Select
       MatlNumber = H6
       Sheets("Summary").Select
       C.Offset(0, 2).Value = MatlNumber

Open in new window

0
Comment
Question by:RWayneH
2 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 2000 total points
ID: 40212501
Try this modification to your code:
       MatlNumber = Range("H6").Value
       Sheets("Summary").Select
       C.Offset(0, 2).Value = MatlNumber

Open in new window


Regards,
-Glenn
0
 

Author Closing Comment

by:RWayneH
ID: 40212516
Yup that was it.  Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

877 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