Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keep Original Sheets Font Format when Populating data into other sheet
Is use this sort of code to pupulate data from one sheet to the other:
With ActiveWorkbook.Worksheets("Sheet A") ..Select Dim rngFound As Range On Error Resume Next ' Gain the Location of the Combobox.Value With Worksheets("Sheet B").Range("A:A") Set rngFound = .Find(What:=Me.TextBox4.Value, After:=.Range("A1"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False) ' Place Data Range("O4").Value = TextBox4.Value Range("O2").Value = rngFound.Offset(-1, 4).Value Range("E2").Value = rngFound.Offset(-1, 2).Value Range("E4").Value = rngFound.Offset(0, 2).Value I want the Font Format to be AS IS from sheet1 to sheet2. Some of the Fonts haver Font.Strikethrough, but when the data is copied to the other sheet using the above code, the fonts are always normal. How can i adapt the code to do this? Is it possible to do this by a line of code, rather than changing each (rngFound.offset(*,*)) line ? Corey.... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keep Original Sheets Font Format when Populating data into other s
All you are doing is making one value equal to the other. you are not doing
anything to change the formats. To do that the easiest is to copy and paste (or pastespecial if your found cells are formulas.). There is no easy one liner as you would like... -- HTH... Jim Thomlinson "Corey ...." wrote: Is use this sort of code to pupulate data from one sheet to the other: With ActiveWorkbook.Worksheets("Sheet A") ..Select Dim rngFound As Range On Error Resume Next ' Gain the Location of the Combobox.Value With Worksheets("Sheet B").Range("A:A") Set rngFound = .Find(What:=Me.TextBox4.Value, After:=.Range("A1"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False) ' Place Data Range("O4").Value = TextBox4.Value Range("O2").Value = rngFound.Offset(-1, 4).Value Range("E2").Value = rngFound.Offset(-1, 2).Value Range("E4").Value = rngFound.Offset(0, 2).Value I want the Font Format to be AS IS from sheet1 to sheet2. Some of the Fonts haver Font.Strikethrough, but when the data is copied to the other sheet using the above code, the fonts are always normal. How can i adapt the code to do this? Is it possible to do this by a line of code, rather than changing each (rngFound.offset(*,*)) line ? Corey.... |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Keep Original Sheets Font Format when Populating data into other s
Jim,
thanks for ther reply. So something like this: rngFound.Offset(-1, 4).Copy Range("O2").Paste And do likewise to ALL cells? "Jim Thomlinson" wrote in message ... All you are doing is making one value equal to the other. you are not doing anything to change the formats. To do that the easiest is to copy and paste (or pastespecial if your found cells are formulas.). There is no easy one liner as you would like... -- HTH... Jim Thomlinson "Corey ...." wrote: Is use this sort of code to pupulate data from one sheet to the other: With ActiveWorkbook.Worksheets("Sheet A") ..Select Dim rngFound As Range On Error Resume Next ' Gain the Location of the Combobox.Value With Worksheets("Sheet B").Range("A:A") Set rngFound = .Find(What:=Me.TextBox4.Value, After:=.Range("A1"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False) ' Place Data Range("O4").Value = TextBox4.Value Range("O2").Value = rngFound.Offset(-1, 4).Value Range("E2").Value = rngFound.Offset(-1, 2).Value Range("E4").Value = rngFound.Offset(0, 2).Value I want the Font Format to be AS IS from sheet1 to sheet2. Some of the Fonts haver Font.Strikethrough, but when the data is copied to the other sheet using the above code, the fonts are always normal. How can i adapt the code to do this? Is it possible to do this by a line of code, rather than changing each (rngFound.offset(*,*)) line ? Corey.... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data sheet populating into multiple sheets | New Users to Excel | |||
Data Sheet populating to multiple sheets | Excel Worksheet Functions | |||
Populating one sheet with data from other sheets | Excel Programming | |||
populating sheet with data from other sheets | New Users to Excel | |||
Making different sheet from the original sheets data | Excel Programming |