Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Update value of variable from one sheet to paste into another shee

Could somebody please tell me how to select a specific cell and store the
text string of the cell into a string variable.

I then want to seach for the string on another sheet and paste into the cell
on the RH side of the cell that was searched for.

e.g

Dim i As String

ActiveSheet.Range("A1").Select
i = ActiveCell.FormulaR1C1

' search for i on another sheet.

Sheets("Standards").Select
Cells.Find (i)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1=i

Is this correct ?
I'm pretty new at this and have had no training.

Thanks for any help you can provide.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 132
Default Update value of variable from one sheet to paste into another shee

Once you find the cell, you need to select it:
Cells.Find(i).select

Then things should work. Are you certain the value you are looking for will
always exist on your "Standards" sheet?

Bill


"tibbs" wrote:

Could somebody please tell me how to select a specific cell and store the
text string of the cell into a string variable.

I then want to seach for the string on another sheet and paste into the cell
on the RH side of the cell that was searched for.

e.g

Dim i As String

ActiveSheet.Range("A1").Select
i = ActiveCell.FormulaR1C1

' search for i on another sheet.

Sheets("Standards").Select
Cells.Find (i)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1=i

Is this correct ?
I'm pretty new at this and have had no training.

Thanks for any help you can provide.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Update value of variable from one sheet to paste into another shee

Sub Findit()
Dim sh1 As Worksheet
Dim sh2 As Worksheet
Dim s As String, rng As Range
Set sh1 = Activesheet
Set sh2 = Worksheets("Standards")
s = sh1.Range("A1")
Set rng = sh2.Cells.Find(What:=s, _
After:=sh2.Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
rng.Offset(0, 1) = s
Else
msgbox s & " wasn't found on Standard"
End If
End Sub



--
Regards,
Tom Ogilvy


"tibbs" wrote:

Could somebody please tell me how to select a specific cell and store the
text string of the cell into a string variable.

I then want to seach for the string on another sheet and paste into the cell
on the RH side of the cell that was searched for.

e.g

Dim i As String

ActiveSheet.Range("A1").Select
i = ActiveCell.FormulaR1C1

' search for i on another sheet.

Sheets("Standards").Select
Cells.Find (i)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1=i

Is this correct ?
I'm pretty new at this and have had no training.

Thanks for any help you can provide.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Update value of variable from one sheet to paste into another shee

Thats great thanks, I'm using it in a macro to select standard pages for an
electrical drawing from a spreadsheet. The final list will be imported into a
cad package as a .prn file to create electrical drawings automatically from
the standards sheets.

Thanks again.

"tibbs" wrote:

Could somebody please tell me how to select a specific cell and store the
text string of the cell into a string variable.

I then want to seach for the string on another sheet and paste into the cell
on the RH side of the cell that was searched for.

e.g

Dim i As String

ActiveSheet.Range("A1").Select
i = ActiveCell.FormulaR1C1

' search for i on another sheet.

Sheets("Standards").Select
Cells.Find (i)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1=i

Is this correct ?
I'm pretty new at this and have had no training.

Thanks for any help you can provide.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Update value of variable from one sheet to paste into another

Thanks very much, this is an excellent support page.

"Tom Ogilvy" wrote:

Sub Findit()
Dim sh1 As Worksheet
Dim sh2 As Worksheet
Dim s As String, rng As Range
Set sh1 = Activesheet
Set sh2 = Worksheets("Standards")
s = sh1.Range("A1")
Set rng = sh2.Cells.Find(What:=s, _
After:=sh2.Range("IV65536"), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
rng.Offset(0, 1) = s
Else
msgbox s & " wasn't found on Standard"
End If
End Sub



--
Regards,
Tom Ogilvy


"tibbs" wrote:

Could somebody please tell me how to select a specific cell and store the
text string of the cell into a string variable.

I then want to seach for the string on another sheet and paste into the cell
on the RH side of the cell that was searched for.

e.g

Dim i As String

ActiveSheet.Range("A1").Select
i = ActiveCell.FormulaR1C1

' search for i on another sheet.

Sheets("Standards").Select
Cells.Find (i)
ActiveCell.Offset(0, 1).Select
ActiveCell.FormulaR1C1=i

Is this correct ?
I'm pretty new at this and have had no training.

Thanks for any help you can provide.

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
Updating workbook with an alpha sort sheet and a numeric sort shee cjlatta Excel Discussion (Misc queries) 2 January 28th 09 12:00 AM
look up data from a one w/sheet and take results to another w/shee AndyJ Excel Discussion (Misc queries) 0 January 11th 08 08:14 PM
Auto input data on one sheet based on row selected in another shee Cheese_whiz New Users to Excel 4 November 27th 07 06:17 PM
Copy and paste cahrt to new sheet-update data automatically? SKlee Charts and Charting in Excel 5 May 28th 07 02:00 PM
How do I copy page setup from one worksheet & paste into new shee. Rasc0 Excel Discussion (Misc queries) 2 December 1st 04 10:12 PM


All times are GMT +1. The time now is 05:48 PM.

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

About Us

"It's about Microsoft Excel"