Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Selecting a range defined in a cell

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
CmK CmK is offline
external usenet poster
 
Posts: 69
Default Selecting a range defined in a cell

What i remember you have the activate the sheet before you select the cell
This formula
ActiveWorkbook.Sheet1.Range.Value=("u4").Select
Just wont select the cell
if you just want the value in thet cell u can make it a variable

Hope this helped

thanks

"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Selecting a range defined in a cell

How would I make it a variable? I am rather new to this...

"CmK" wrote:

What i remember you have the activate the sheet before you select the cell
This formula
ActiveWorkbook.Sheet1.Range.Value=("u4").Select
Just wont select the cell
if you just want the value in thet cell u can make it a variable

Hope this helped

thanks

"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

  #4   Report Post  
Posted to microsoft.public.excel.programming
CmK CmK is offline
external usenet poster
 
Posts: 69
Default Selecting a range defined in a cell

Hi
Well that depends
Do you only want to select the cell(u4) if so then you have to activate the
sheet before you select the cell
If there is a value in the cell that you would want to use then you can make
it a variable
Just let me now what you are planning to do with the cell first

thanks hope it helped

"Alex" wrote:

How would I make it a variable? I am rather new to this...

"CmK" wrote:

What i remember you have the activate the sheet before you select the cell
This formula
ActiveWorkbook.Sheet1.Range.Value=("u4").Select
Just wont select the cell
if you just want the value in thet cell u can make it a variable

Hope this helped

thanks

"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Selecting a range defined in a cell

Assume A1 on Sheet1 holds the Text "U4" without the double quotes

Dim s as String
Wtih Activeworkbook.Worksheets("Sheet1")
s = .Range("A1")
Application.Goto .Range(s)
End with

If that isn't what you want, then perhaps providing a clearer explanation
would help.

--
Regards,
Tom Ogilvy


"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Selecting a range defined in a cell

I thought is best to post the whole string below.

What I am trying to do is select a portion of my sheet (defined in cell u4)
then open another workbook, Copy trhat data to it, Save the workbook using a
name defined in another cell and then close the newly created workbook.
Everything else in the below code works. I have used it a lot before. The
only problem is the first line to select a range based on the data in cell u4.

I hope this helps.

Private Sub CommandButton2_Click()

ActiveWorkbook.Sheet1.Range.value_("u4").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub

"Tom Ogilvy" wrote:

Assume A1 on Sheet1 holds the Text "U4" without the double quotes

Dim s as String
Wtih Activeworkbook.Worksheets("Sheet1")
s = .Range("A1")
Application.Goto .Range(s)
End with

If that isn't what you want, then perhaps providing a clearer explanation
would help.

--
Regards,
Tom Ogilvy


"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

  #7   Report Post  
Posted to microsoft.public.excel.programming
CmK CmK is offline
external usenet poster
 
Posts: 69
Default Selecting a range defined in a cell

Hi

try the one below see how you go thanks


Private Sub CommandButton2_Click()
Dim A as string

a = Range("U4").Value
Range(a).Activate

Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub


"Alex" wrote:

I thought is best to post the whole string below.

What I am trying to do is select a portion of my sheet (defined in cell u4)
then open another workbook, Copy trhat data to it, Save the workbook using a
name defined in another cell and then close the newly created workbook.
Everything else in the below code works. I have used it a lot before. The
only problem is the first line to select a range based on the data in cell u4.

I hope this helps.

Private Sub CommandButton2_Click()

ActiveWorkbook.Sheet1.Range.value_("u4").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub

"Tom Ogilvy" wrote:

Assume A1 on Sheet1 holds the Text "U4" without the double quotes

Dim s as String
Wtih Activeworkbook.Worksheets("Sheet1")
s = .Range("A1")
Application.Goto .Range(s)
End with

If that isn't what you want, then perhaps providing a clearer explanation
would help.

--
Regards,
Tom Ogilvy


"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Selecting a range defined in a cell

I tried it as you wrote it and it got stuck on Range(a).activate..

I tried to pull that line just for kicks and it went back to making a file
with the only the values of U4 in it and not what those values refer to...

Any more idea's for me?

"CmK" wrote:

Hi

try the one below see how you go thanks


Private Sub CommandButton2_Click()
Dim A as string

a = Range("U4").Value
Range(a).Activate

Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub


"Alex" wrote:

I thought is best to post the whole string below.

What I am trying to do is select a portion of my sheet (defined in cell u4)
then open another workbook, Copy trhat data to it, Save the workbook using a
name defined in another cell and then close the newly created workbook.
Everything else in the below code works. I have used it a lot before. The
only problem is the first line to select a range based on the data in cell u4.

I hope this helps.

Private Sub CommandButton2_Click()

ActiveWorkbook.Sheet1.Range.value_("u4").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub

"Tom Ogilvy" wrote:

Assume A1 on Sheet1 holds the Text "U4" without the double quotes

Dim s as String
Wtih Activeworkbook.Worksheets("Sheet1")
s = .Range("A1")
Application.Goto .Range(s)
End with

If that isn't what you want, then perhaps providing a clearer explanation
would help.

--
Regards,
Tom Ogilvy


"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

  #9   Report Post  
Posted to microsoft.public.excel.programming
CmK CmK is offline
external usenet poster
 
Posts: 69
Default Selecting a range defined in a cell

Sorry try this one
Select instead of activate
and shortened the vba a bit

Private Sub CommandButton2_Click()

Dim A As String

A = Range("U4").Value
Range(A).Select

Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") _
& ".xls", FileFormat:=xlCSVMSDOS

ActiveWorkbook.Close

end sub

"Alex" wrote:

I tried it as you wrote it and it got stuck on Range(a).activate..

I tried to pull that line just for kicks and it went back to making a file
with the only the values of U4 in it and not what those values refer to...

Any more idea's for me?

"CmK" wrote:

Hi

try the one below see how you go thanks


Private Sub CommandButton2_Click()
Dim A as string

a = Range("U4").Value
Range(a).Activate

Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub


"Alex" wrote:

I thought is best to post the whole string below.

What I am trying to do is select a portion of my sheet (defined in cell u4)
then open another workbook, Copy trhat data to it, Save the workbook using a
name defined in another cell and then close the newly created workbook.
Everything else in the below code works. I have used it a lot before. The
only problem is the first line to select a range based on the data in cell u4.

I hope this helps.

Private Sub CommandButton2_Click()

ActiveWorkbook.Sheet1.Range.value_("u4").Select
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.SaveAs "C:\" & ThisWorkbook.ActiveSheet.Range("u3") &
".xls" _
, FileFormat:=xlCSVMSDOS, CreateBackup:=False
ActiveWorkbook.Close
End Sub

"Tom Ogilvy" wrote:

Assume A1 on Sheet1 holds the Text "U4" without the double quotes

Dim s as String
Wtih Activeworkbook.Worksheets("Sheet1")
s = .Range("A1")
Application.Goto .Range(s)
End with

If that isn't what you want, then perhaps providing a clearer explanation
would help.

--
Regards,
Tom Ogilvy


"Alex" wrote:

I am trying to select a range that is defined in a cell on sheet 1. this is
what i have but am getting no place with it. any ideas?

ActiveWorkbook.Sheet1.Range.Value=("u4").Select

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
Dynamic Range Defined by Value of Cell Domenick Excel Worksheet Functions 7 December 18th 09 01:53 PM
Application-defined or object-defined error (worksheet, range, sel darxoul Excel Programming 4 August 2nd 06 01:59 PM
Copying A Range of Cells From one Sheet to Another - Error Application Defined or Object Defined Matt[_39_] Excel Programming 3 July 25th 06 01:13 AM
Selecting range in list of range names depending on a cell informa Courreges Excel Discussion (Misc queries) 2 June 19th 06 10:59 AM
User Defined formula, selecting range [email protected] Excel Programming 3 January 5th 06 09:27 AM


All times are GMT +1. The time now is 03:20 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"