USER EMAIL : Convert .xls file to .xlsx using macro




EMAIL


I am very new to excel and never touched Macros in my life. I recently changed jobs. I moved from being a Manufacturing engineer to a reliability engineer. I have no idea what macros do. My manager gave me few tasks and I consider them tough because I have never used macros before.

He asked me to Create macros for the following:

  1. He asked me to create a macro to save a 07 excel format file as .xlsx format (2013 format)
  2. He asked me to concatenate three columns into a single colum
Please help with these.




REPLY


Thank you for writing to Extreme Excel Solutions!!!

1. xlsx was introduced with 2007 and continued with later versions. Prior versions only support .xls version. Later versions offer backward compatibility and you can open.xls files there too. To covert a .xls file to .xlsx you need to write a macro in newer version and that macro should do these steps manually or using vba.
  a. Open the file
  b. Perform Save As action and choose type as .xls
  c. Close file.

2. Concatenation is simple.

Let's say
A1=Hello
B1=World
C1=!!
To concatenate and put result in D1, you can use formula in D1
=A1 & B1 & C1
or
=Concatenate(A1,B1,C1)
To do this using VBA, you can write
Sub yourmacroname()
 Cells(1,4).value =  Cells(1,1).value &  Cells(1,2).value & Cells(1,3).value
End Sub
Subscribe to our youtube channel and keep checking video tutorials to learn excel and vba.