Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / April 2007

Tip: Looking for answers? Try searching our database.

INPUT RANGE

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dancer - 21 Apr 2007 00:03 GMT
In the following code I want to have the program ask me what range and then
substitute that range for "Dasher_accounts".

How?

For Each cell In ThisWorkbook.Sheets("lists") _
       .Range("Dasher_accounts").Cells.SpecialCells(xlCellTypeConstants)

       ThisWorkbook.Sheets("Sheet1").Range("crit_cell").Value = cell.Value
    make_chart
   ActiveWorkbook.Worksheets("Sheet2").ChartObjects("Chart 1").Chart.Export
_
           Filename:=Fname, FilterName:="GIF"

       .Attachments.Add Fname

Next cell
Dave Peterson - 21 Apr 2007 02:01 GMT
Does the range have to be on Lists in the workbook with the code?

Dim myRng as range
dim myRngC as range
dim Cell as range

set myRng = nothing
on error resume next
set myrng = application.inputbox(Prompt:="Select a range",type:=8)
on error goto 0

if myrng is nothing then
  exit sub 'user hit cancel
end if

if myrng.parent.range("a1").address(external:=true) _
  <> thisworkbook.worksheets("lists").range("a1").address(external:=true) then
   msgbox "Please select a range on Lists in: " & thisworkbook.name
   exit sub
end if

set myrngC = nothing
on error resume next
set myrngc = myrng.cells.specialcells(xlcelltypeconstants)
on error goto 0

if myrngc is nothing then
  msgbox "no constants in that range!"
  exit sub
end if

for each cell in myrngc.cells
 'do your stuff.
 ....

> In the following code I want to have the program ask me what range and then
> substitute that range for "Dasher_accounts".
[quoted text clipped - 13 lines]
>
> Next cell

Signature

Dave Peterson


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.