Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie Q: Specifying external Sheet name from Inputbox


Guys I think the macro better explains what Im trying to achieve...

Dim CurMonth As String
Sheets(Array("UK", "FR", "IT", "ES")).Select
Sheets("UK").Activate
ActiveCell.Offset(0, -4).Columns("A:D").EntireColumn.Select
Selection.Copy
ActiveCell.Offset(0, 4).Range("A1").Select
Selection.Insert Shift:=xlToRight
ActiveCell.Offset(0, 3).Range("A1").Select
CurMonth = InputBox("Enter the Month 'Format: Month #'")
ActiveCell = CurMonth
ActiveCell.Offset(3, 0).Range("A1").Select
ActiveCell.Value = "='[Book3]Curmonth'!B4"

What I want to do is tell the macro to look in a sheet in another
workbook for some data. The sheet should have the same name as in the
string that I get from the Input box. How do I achieve that please?

Also what property do I use if I want to change the external reference
from constant (meaning with $ reference "$A$2") to variable ("A2").

Hope I make sense...


--
Kayote
------------------------------------------------------------------------
Kayote's Profile: http://www.excelforum.com/member.php...o&userid=33314
View this thread: http://www.excelforum.com/showthread...hreadid=539678

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Newbie Q: Specifying external Sheet name from Inputbox

ActiveCell.Formula = "='[Book3]" & Curmonth & "'!B4"

It already is variable.

--
Regards,
Tom Ogilvy


"Kayote" wrote in
message ...

Guys I think the macro better explains what Im trying to achieve...

Dim CurMonth As String
Sheets(Array("UK", "FR", "IT", "ES")).Select
Sheets("UK").Activate
ActiveCell.Offset(0, -4).Columns("A:D").EntireColumn.Select
Selection.Copy
ActiveCell.Offset(0, 4).Range("A1").Select
Selection.Insert Shift:=xlToRight
ActiveCell.Offset(0, 3).Range("A1").Select
CurMonth = InputBox("Enter the Month 'Format: Month #'")
ActiveCell = CurMonth
ActiveCell.Offset(3, 0).Range("A1").Select
ActiveCell.Value = "='[Book3]Curmonth'!B4"

What I want to do is tell the macro to look in a sheet in another
workbook for some data. The sheet should have the same name as in the
string that I get from the Input box. How do I achieve that please?

Also what property do I use if I want to change the external reference
from constant (meaning with $ reference "$A$2") to variable ("A2").

Hope I make sense...


--
Kayote
------------------------------------------------------------------------
Kayote's Profile:

http://www.excelforum.com/member.php...o&userid=33314
View this thread: http://www.excelforum.com/showthread...hreadid=539678



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Newbie Q: Specifying external Sheet name from Inputbox


Tom you are a star. I aspire to be as good as you!

Many thanks


--
Kayote
------------------------------------------------------------------------
Kayote's Profile: http://www.excelforum.com/member.php...o&userid=33314
View this thread: http://www.excelforum.com/showthread...hreadid=539678

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Select Range off sheet from inputbox Jim May Excel Discussion (Misc queries) 4 September 29th 07 08:26 PM
Expenses Spread sheet Tutorial for Newbie ? [email protected] Excel Discussion (Misc queries) 3 May 11th 06 06:25 PM
InputBox to capture user selected sheet names? quartz[_2_] Excel Programming 7 December 3rd 05 10:51 AM
Newbie question about accessing Excel sheet from the web Patrick[_10_] Excel Programming 0 August 10th 04 06:50 PM
Newbie Question: Returning the value from a cell on another sheet SmilingPolitely[_2_] Excel Programming 4 July 14th 04 01:23 PM


All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"