Formating Excel Worksheet from a different workbook's VBA -
I am working with several Excel files (for copying information from a master file for reporting small and In specific files) and I'm having trouble getting my master file to format field files, while it contains information in them. Here is the relevant code:
The form of a slow XL In Excel, the application is dim I_workbook as Excel. Set Excel to workbook in dim form.Welcome xl = CreateObject ("Excel.Application") I_workbook = xl Workbooks Open ("H: \ ....") Set ws = I_workbook.Sheets ("Sheet1") 'Enter information in Wes' This part works because I know I have the right object and In this case there are ranges like dim range for each RNG. Range ("B2", "B" and (BTRO-Top-Rau + 2)) RGS Selection selection Number format = "normal" 'rng.NumberFormat = "normal" Next RNG I_workbook.Save xl.Quit I am trying to take all the cells from which I have kept the information and have them Formatted as number. Some time they are number and sonetimes, they are number one after the letter. Their source is a text field in a database so Excel reads them as text and then puts a nice annoying green triangle in the corner, which allows someone to raise, so I sit ... < P> Comment Line Rng.NumberFormat = "General" I have another attempt that does not work. thanks
rng.Numberformat Work should not work unless there's more to the story, but in reality you do not need a loop to do this: Ws.Range ("B2", "B" & amp; (BotRow - TopRow + 2)). Format = "General" If enough data numbers are stored in the form of text, then you can use something like this: < Ws.Range ("B2", "B" & (BotRow - TopRow + 2)) with nformform = "General" .Value2 = .Value2 End
Comments
Post a Comment