Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Updating workbook with an alpha sort sheet and a numeric sort shee | Excel Discussion (Misc queries) | |||
look up data from a one w/sheet and take results to another w/shee | Excel Discussion (Misc queries) | |||
Auto input data on one sheet based on row selected in another shee | New Users to Excel | |||
Copy and paste cahrt to new sheet-update data automatically? | Charts and Charting in Excel | |||
How do I copy page setup from one worksheet & paste into new shee. | Excel Discussion (Misc queries) |